本文整理汇总了C#中EmptyRepositoryFixture.ExecuteGitVersion方法的典型用法代码示例。如果您正苦于以下问题:C# EmptyRepositoryFixture.ExecuteGitVersion方法的具体用法?C# EmptyRepositoryFixture.ExecuteGitVersion怎么用?C# EmptyRepositoryFixture.ExecuteGitVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmptyRepositoryFixture
的用法示例。
在下文中一共展示了EmptyRepositoryFixture.ExecuteGitVersion方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MinorReleaseExample
public void MinorReleaseExample()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.2.0");
// Branch to develop
fixture.Repository.CreateBranch("develop").Checkout();
fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0.0-unstable");
// Open Pull Request
fixture.Repository.CreateBranch("pull/2/merge").Checkout();
fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0-PullRequest.2+0");
fixture.Repository.MakeACommit();
fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0-PullRequest.2+1");
// Merge into develop
fixture.Repository.Checkout("develop");
fixture.Repository.MergeNoFF("pull/2/merge", Constants.SignatureNow());
fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0.2-unstable");
// Create release branch
fixture.Repository.CreateBranch("release-1.3.0").Checkout();
fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0-beta.1+0");
// Make another commit on develop
fixture.Repository.Checkout("develop");
fixture.Repository.MakeACommit();
fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0.3-unstable");
// Make a commit to release-1.3.0
fixture.Repository.Checkout("release-1.3.0");
fixture.Repository.MakeACommit();
fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0-beta.1+1");
// Apply beta.0 tag
fixture.Repository.ApplyTag("1.3.0-beta.1");
fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0-beta.2+1");
// Merge release branch to master
fixture.Repository.Checkout("master");
fixture.Repository.MergeNoFF("release-1.3.0", Constants.SignatureNow());
fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0");
fixture.Repository.ApplyTag("1.3.0");
// Verify develop version
fixture.Repository.Checkout("develop");
fixture.Repository.MergeNoFF("release-1.3.0", Constants.SignatureNow());
fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.4.0.2-unstable");
}
}
示例2: WhenDevelopBranchedFromMaster_MinorIsIncreased
public void WhenDevelopBranchedFromMaster_MinorIsIncreased()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.CreateBranch("develop").Checkout();
var result = fixture.ExecuteGitVersion();
result.OutputVariables[VariableProvider.SemVer].ShouldBe("1.1.0.0-unstable");
}
}
示例3: GivenARepositoryWithTagAndNoNextVersionTxtFile_VersionShouldBeTagWithBumpedPatch
public void GivenARepositoryWithTagAndNoNextVersionTxtFile_VersionShouldBeTagWithBumpedPatch()
{
using (var fixture = new EmptyRepositoryFixture())
{
const string TaggedVersion = "1.0.3";
fixture.Repository.MakeATaggedCommit(TaggedVersion);
fixture.Repository.MakeCommits(5);
var result = fixture.ExecuteGitVersion();
result.ExitCode.ShouldBe(0);
result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.0.4+5");
}
}
示例4: GivenARepositoryWithTagAndANextVersionTxtFileAndNoCommits_VersionShouldBeTag
public void GivenARepositoryWithTagAndANextVersionTxtFileAndNoCommits_VersionShouldBeTag()
{
using (var fixture = new EmptyRepositoryFixture())
{
const string ExpectedNextVersion = "1.1.0";
const string TaggedVersion = "1.0.3";
fixture.Repository.MakeATaggedCommit(TaggedVersion);
fixture.Repository.AddNextVersionTxtFile(ExpectedNextVersion);
var result = fixture.ExecuteGitVersion();
result.ExitCode.ShouldBe(0);
result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.0.3+0");
}
}
示例5: GivenARepositoryWithNoTagsAndANextVersionTxtFile_VersionShouldMatchVersionTxtFile
public void GivenARepositoryWithNoTagsAndANextVersionTxtFile_VersionShouldMatchVersionTxtFile()
{
using (var fixture = new EmptyRepositoryFixture())
{
const string ExpectedNextVersion = "1.0.0";
fixture.Repository.MakeACommit();
fixture.Repository.MakeACommit();
fixture.Repository.MakeACommit();
fixture.Repository.AddNextVersionTxtFile(ExpectedNextVersion);
var result = fixture.ExecuteGitVersion();
result.ExitCode.ShouldBe(0);
result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.0.0+2");
}
}
示例6: GivenARepositoryWithCommitsButNoTags_VersionShouldBe_0_1
public void GivenARepositoryWithCommitsButNoTags_VersionShouldBe_0_1()
{
using (var fixture = new EmptyRepositoryFixture())
{
// Given
fixture.Repository.MakeACommit();
fixture.Repository.MakeACommit();
fixture.Repository.MakeACommit();
// When
var result = fixture.ExecuteGitVersion();
result.ExitCode.ShouldBe(0);
result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("0.1.0+2");
}
}
示例7: CanTakeVersionFromReleaseBranch
public void CanTakeVersionFromReleaseBranch()
{
using (var fixture = new EmptyRepositoryFixture())
{
const string TaggedVersion = "1.0.3";
fixture.Repository.MakeATaggedCommit(TaggedVersion);
fixture.Repository.MakeCommits(5);
fixture.Repository.CreateBranch("release-2.0.0");
fixture.Repository.Checkout("release-2.0.0");
var result = fixture.ExecuteGitVersion();
result.ExitCode.ShouldBe(0);
result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("2.0.0-beta.1+5");
}
}
示例8: WhenReleaseBranchIsMergedIntoMasterVersionIsTakenWithIt
public void WhenReleaseBranchIsMergedIntoMasterVersionIsTakenWithIt()
{
using (var fixture = new EmptyRepositoryFixture())
{
const string TaggedVersion = "1.0.3";
fixture.Repository.MakeATaggedCommit(TaggedVersion);
fixture.Repository.MakeCommits(1);
fixture.Repository.CreateBranch("release-2.0.0");
fixture.Repository.Checkout("release-2.0.0");
fixture.Repository.MakeCommits(4);
fixture.Repository.Checkout("master");
fixture.Repository.MergeNoFF("release-2.0.0", Constants.SignatureNow());
var result = fixture.ExecuteGitVersion();
result.ExitCode.ShouldBe(0);
result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("2.0.0+6");
}
}