本文整理汇总了C#中EmptyRepositoryFixture.MakeACommit方法的典型用法代码示例。如果您正苦于以下问题:C# EmptyRepositoryFixture.MakeACommit方法的具体用法?C# EmptyRepositoryFixture.MakeACommit怎么用?C# EmptyRepositoryFixture.MakeACommit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmptyRepositoryFixture
的用法示例。
在下文中一共展示了EmptyRepositoryFixture.MakeACommit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GitFlowPullRequestBranch
public void GitFlowPullRequestBranch()
{
using (var fixture = new EmptyRepositoryFixture(new Config()))
{
fixture.Participant("master");
fixture.Participant("develop");
// GitFlow setup
fixture.Repository.MakeACommit();
fixture.ApplyTag("1.2.0");
fixture.BranchTo("develop");
// Branch to develop
fixture.MakeACommit();
fixture.AssertFullSemver("1.3.0-unstable.1");
// Open Pull Request
fixture.BranchTo("pull/2/merge", "pr");
fixture.Activate("pull/2/merge");
fixture.AssertFullSemver("1.3.0-PullRequest.2+1");
fixture.MakeACommit();
fixture.AssertFullSemver("1.3.0-PullRequest.2+2");
// Merge into develop
fixture.Checkout("develop");
fixture.MergeNoFF("pull/2/merge");
fixture.Destroy("pull/2/merge");
fixture.NoteOver("Feature branches/pr's should\r\n" +
"be deleted once merged", "pull/2/merge");
fixture.AssertFullSemver("1.3.0-unstable.3");
}
}
示例2: GitFlowHotfixBranch
public void GitFlowHotfixBranch()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.SequenceDiagram.Participant("develop");
fixture.SequenceDiagram.Participant("master");
fixture.Repository.MakeACommit();
fixture.ApplyTag("1.2.0");
// Create hotfix branch
fixture.Checkout("master");
fixture.BranchTo("hotfix/1.2.1", "hotfix");
fixture.SequenceDiagram.Activate("hotfix/1.2.1");
fixture.MakeACommit();
fixture.MakeACommit();
fixture.AssertFullSemver("1.2.1-beta.1+2");
// Apply beta.1 tag should be exact tag
fixture.ApplyTag("1.2.1-beta.1");
fixture.AssertFullSemver("1.2.1-beta.1");
fixture.Checkout("master");
fixture.MergeNoFF("hotfix/1.2.1");
fixture.SequenceDiagram.Destroy("hotfix/1.2.1");
fixture.SequenceDiagram.NoteOver("Hotfix branches are deleted once merged", "hotfix/1.2.1");
fixture.ApplyTag("1.2.1");
}
}
示例3: GitFlowPullRequestBranch
public void GitFlowPullRequestBranch()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.SequenceDiagram.Participant("master");
fixture.SequenceDiagram.Participant("develop");
// GitFlow setup
fixture.Repository.MakeACommit();
fixture.ApplyTag("1.2.0");
fixture.BranchTo("develop");
// Branch to develop
fixture.MakeACommit();
fixture.AssertFullSemver("1.3.0-alpha.1");
// Open Pull Request
fixture.BranchTo("pull/2/merge", "pr");
fixture.SequenceDiagram.Activate("pull/2/merge");
fixture.AssertFullSemver("1.3.0-PullRequest0002.1");
fixture.MakeACommit();
fixture.AssertFullSemver("1.3.0-PullRequest0002.2");
// Merge into develop
fixture.Checkout("develop");
fixture.MergeNoFF("pull/2/merge");
fixture.SequenceDiagram.Destroy("pull/2/merge");
fixture.SequenceDiagram.NoteOver("Feature branches/pr's should\r\n" +
"be deleted once merged", "pull/2/merge");
fixture.AssertFullSemver("1.3.0-alpha.3");
Console.WriteLine(fixture.SequenceDiagram.GetDiagram());
}
}
示例4: GitFlowFeatureBranch
public void GitFlowFeatureBranch()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.SequenceDiagram.Participant("master");
fixture.SequenceDiagram.Participant("develop");
// GitFlow setup
fixture.Repository.MakeACommit();
fixture.ApplyTag("1.2.0");
fixture.BranchTo("develop");
// Branch to develop
fixture.MakeACommit();
fixture.AssertFullSemver("1.3.0-unstable.1");
// Open Pull Request
fixture.BranchTo("feature/myfeature", "feature");
fixture.SequenceDiagram.Activate("feature/myfeature");
fixture.AssertFullSemver("1.3.0-myfeature.1+1");
fixture.MakeACommit();
fixture.AssertFullSemver("1.3.0-myfeature.1+2");
// Merge into develop
fixture.Checkout("develop");
fixture.MergeNoFF("feature/myfeature");
fixture.SequenceDiagram.Destroy("feature/myfeature");
fixture.SequenceDiagram.NoteOver("Feature branches should\r\n" +
"be deleted once merged", "feature/myfeature");
fixture.AssertFullSemver("1.3.0-unstable.3");
}
}
示例5: NormalisationOfTag
public void NormalisationOfTag()
{
using (var fixture = new EmptyRepositoryFixture(new Config()))
{
fixture.Repository.MakeACommit();
fixture.Repository.Checkout(fixture.Repository.CreateBranch("feature/foo"));
fixture.Repository.MakeACommit();
fixture.BranchTo("release/2.0.0");
fixture.MakeACommit();
fixture.MakeATaggedCommit("2.0.0-rc.1");
fixture.Checkout("master");
fixture.MergeNoFF("release/2.0.0");
fixture.Repository.Branches.Remove(fixture.Repository.FindBranch("release/2.0.0"));
var remoteTagSha = fixture.Repository.Tags["2.0.0-rc.1"].Target.Sha;
using (var localFixture = fixture.CloneRepository())
{
localFixture.Checkout(remoteTagSha);
GitHelper.NormalizeGitDirectory(localFixture.RepositoryPath, new Authentication(), noFetch: false, currentBranch: string.Empty);
localFixture.AssertFullSemver("2.0.0-rc.1");
}
}
}
示例6: NormalisationOfTag
public void NormalisationOfTag()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeACommit();
fixture.Repository.Checkout(fixture.Repository.CreateBranch("feature/foo"));
fixture.Repository.MakeACommit();
fixture.BranchTo("release/2.0.0");
fixture.MakeACommit();
fixture.MakeATaggedCommit("2.0.0-rc.1");
fixture.Checkout("master");
fixture.MergeNoFF("release/2.0.0");
fixture.Repository.Branches.Remove(fixture.Repository.Branches["release/2.0.0"]);
var remoteTagSha = fixture.Repository.Tags["2.0.0-rc.1"].Target.Sha;
using (var localFixture = fixture.CloneRepository())
{
localFixture.Checkout(remoteTagSha);
GitRepositoryHelper.NormalizeGitDirectory(localFixture.RepositoryPath, new AuthenticationInfo(), noFetch: false, currentBranch: string.Empty);
localFixture.Repository.Head.FriendlyName.ShouldBe("(no branch)");
localFixture.Repository.Head.Tip.Sha.ShouldBe(remoteTagSha);
}
}
}
示例7: TheReadmeSample
public void TheReadmeSample()
{
using (LogHelper.Capture(_outputHelper, LogProvider.SetCurrentLogProvider))
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.MakeACommit();
fixture.MakeACommit();
fixture.MakeATaggedCommit("1.0.0");
fixture.BranchTo("develop");
fixture.MakeACommit();
fixture.Checkout("master");
fixture.MergeNoFF("develop");
}
}
}
示例8: InheritVersionFromReleaseBranch
public void InheritVersionFromReleaseBranch()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.MakeATaggedCommit("1.0.0");
fixture.BranchTo("develop");
fixture.MakeACommit();
fixture.BranchTo("release/2.0.0");
fixture.MakeACommit();
fixture.MakeACommit();
fixture.Checkout("develop");
fixture.AssertFullSemver("1.1.0-alpha.1");
fixture.MakeACommit();
fixture.AssertFullSemver("2.1.0-alpha.1");
fixture.MergeNoFF("release/2.0.0");
fixture.AssertFullSemver("2.1.0-alpha.4");
fixture.BranchTo("feature/MyFeature");
fixture.MakeACommit();
fixture.AssertFullSemver("2.1.0-MyFeature.1+3");
}
}
示例9: LogPathContainsForwardSlash
public void LogPathContainsForwardSlash()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.MakeATaggedCommit("1.2.3");
fixture.MakeACommit();
var result = GitVersionHelper.ExecuteIn(fixture.RepositoryPath, arguments: @" /l ""/some/path""", logToFile: false);
result.ExitCode.ShouldBe(0);
result.Output.ShouldContain(@"""MajorMinorPatch"":""1.2.4""");
}
}
示例10: CheckBuildServerVerbosityConsole
public void CheckBuildServerVerbosityConsole(string verbosityArg, string expectedOutput)
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.MakeATaggedCommit("1.2.3");
fixture.MakeACommit();
var result = GitVersionHelper.ExecuteIn(fixture.RepositoryPath, arguments: String.Format( @" {0} -output buildserver /l ""/some/path""", verbosityArg), logToFile: false);
result.ExitCode.ShouldBe(0);
result.Output.ShouldContain(expectedOutput);
}
}
示例11: RunExecViaCommandLine
public void RunExecViaCommandLine()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.MakeATaggedCommit("1.2.3");
fixture.MakeACommit();
var buildFile = Path.Combine(fixture.RepositoryPath, "RunExecViaCommandLine.proj");
File.Delete(buildFile);
const string buildFileContent = @"<?xml version=""1.0"" encoding=""utf-8""?>
<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<Target Name=""OutputResults"">
<Message Text=""GitVersion_FullSemVer: $(GitVersion_FullSemVer)""/>
</Target>
</Project>";
File.WriteAllText(buildFile, buildFileContent);
var result = GitVersionHelper.ExecuteIn(fixture.RepositoryPath, SpecifiedArgumentRunner.BuildTool, "RunExecViaCommandLine.proj /target:OutputResults");
result.ExitCode.ShouldBe(0);
result.Log.ShouldContain("GitVersion_FullSemVer: 1.2.4+1");
}
}
示例12: ShouldPickUpVersionFromMasterAfterReleaseBranchCreated
public void ShouldPickUpVersionFromMasterAfterReleaseBranchCreated()
{
using (var fixture = new EmptyRepositoryFixture())
{
// Create develop and release branches
fixture.MakeACommit();
fixture.BranchTo("develop");
fixture.MakeACommit();
fixture.BranchTo("release/1.0");
fixture.MakeACommit();
fixture.Checkout("develop");
fixture.MakeACommit();
fixture.AssertFullSemver("1.1.0-alpha.1");
// create a misnamed feature branch (i.e. it uses the default config) from develop and verify the version
fixture.BranchTo("misnamed");
fixture.AssertFullSemver("1.1.0-misnamed.1+1");
}
}
示例13: GitHubFlowMajorRelease
public void GitHubFlowMajorRelease()
{
using (var fixture = new EmptyRepositoryFixture(new Config()))
{
fixture.Participant("master");
fixture.Repository.MakeACommit();
fixture.ApplyTag("1.3.0");
// Create release branch
fixture.BranchTo("release/2.0.0", "release");
fixture.Activate("release/2.0.0");
fixture.MakeACommit();
fixture.AssertFullSemver("2.0.0-beta.1+1");
fixture.MakeACommit();
fixture.AssertFullSemver("2.0.0-beta.1+2");
// Apply beta.1 tag should be exact tag
fixture.ApplyTag("2.0.0-beta.1");
fixture.AssertFullSemver("2.0.0-beta.1");
// Make a commit after a tag should bump up the beta
fixture.MakeACommit();
fixture.AssertFullSemver("2.0.0-beta.2+3");
// Complete release
fixture.Checkout("master");
fixture.MergeNoFF("release/2.0.0");
fixture.Destroy("release/2.0.0");
fixture.NoteOver("Release branches are deleted once merged", "release/2.0.0");
fixture.AssertFullSemver("2.0.0+0");
fixture.ApplyTag("2.0.0");
fixture.AssertFullSemver("2.0.0");
fixture.MakeACommit();
fixture.Repository.DumpGraph();
fixture.AssertFullSemver("2.0.1+1");
}
}
示例14: VerifyMergingMasterIntoAFeatureBranchWorksWithMultipleBranches
public void VerifyMergingMasterIntoAFeatureBranchWorksWithMultipleBranches()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.MakeACommit("first in master");
fixture.BranchTo("feature/foo", "foo");
fixture.MakeACommit("first in foo");
fixture.BranchTo("feature/bar", "bar");
fixture.MakeACommit("first in bar");
fixture.Checkout("master");
fixture.MakeACommit("second in master");
fixture.Checkout("feature/foo");
fixture.MergeNoFF("master");
fixture.MakeACommit("second in foo");
fixture.Checkout("feature/bar");
fixture.MergeNoFF("master");
fixture.MakeACommit("second in bar");
fixture.Checkout("master");
fixture.MakeATaggedCommit("1.0.0");
fixture.MergeNoFF("feature/foo");
fixture.MergeNoFF("feature/bar");
fixture.AssertFullSemver(config, "1.0.2");
}
}
示例15: VerifyMergingMasterToFeatureDoesNotStopMasterCommitsIncrementingVersion
public void VerifyMergingMasterToFeatureDoesNotStopMasterCommitsIncrementingVersion()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.MakeACommit("first in master");
fixture.BranchTo("feature/foo", "foo");
fixture.MakeACommit("first in foo");
fixture.Checkout("master");
fixture.MakeATaggedCommit("1.0.0");
fixture.MakeACommit("third in master");
fixture.Checkout("feature/foo");
fixture.MergeNoFF("master");
fixture.MakeACommit("second in foo");
fixture.Checkout("master");
fixture.MergeNoFF("feature/foo");
fixture.AssertFullSemver(config, "1.0.2");
}
}