当前位置: 首页>>代码示例>>C#>>正文


C# EmptyRepositoryFixture.MakeATaggedCommit方法代码示例

本文整理汇总了C#中EmptyRepositoryFixture.MakeATaggedCommit方法的典型用法代码示例。如果您正苦于以下问题:C# EmptyRepositoryFixture.MakeATaggedCommit方法的具体用法?C# EmptyRepositoryFixture.MakeATaggedCommit怎么用?C# EmptyRepositoryFixture.MakeATaggedCommit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EmptyRepositoryFixture的用法示例。


在下文中一共展示了EmptyRepositoryFixture.MakeATaggedCommit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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);
                }
            }
        }
开发者ID:JakeGinnivan,项目名称:GitTools.Core,代码行数:27,代码来源:GitRepositoryHelperTests.cs

示例2: 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");
                }
            }
        }
开发者ID:dimitar,项目名称:GitVersion,代码行数:26,代码来源:GitHelperTests.cs

示例3: 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""");
        }
    }
开发者ID:onovotny,项目名称:GitVersion,代码行数:13,代码来源:ExecCmdLineArgumentTest.cs

示例4: 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);
        }
    }
开发者ID:GitTools,项目名称:GitVersion,代码行数:13,代码来源:ExecCmdLineArgumentTest.cs

示例5: CanUseCommitMessagesToBumpVersion

    public void CanUseCommitMessagesToBumpVersion()
    {
        using (var fixture = new EmptyRepositoryFixture())
        {
            fixture.Repository.MakeACommit();
            fixture.MakeATaggedCommit("1.0.0");
            fixture.Repository.MakeACommit("+semver:minor");

            fixture.AssertFullSemver("1.1.0+1");

            fixture.Repository.MakeACommit("+semver:major");

            fixture.AssertFullSemver("2.0.0+2");
        }
    }
开发者ID:onovotny,项目名称:GitVersion,代码行数:15,代码来源:VersionBumpingScenarios.cs

示例6: 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");
         }
     }
 }
开发者ID:JakeGinnivan,项目名称:GitTools.Testing,代码行数:16,代码来源:Example.cs

示例7: CanUseCommitMessagesToBumpVersionBaseVersionTagIsAppliedToSameCommit

    public void CanUseCommitMessagesToBumpVersionBaseVersionTagIsAppliedToSameCommit()
    {
        using (var fixture = new EmptyRepositoryFixture())
        {
            fixture.Repository.MakeACommit();
            fixture.MakeATaggedCommit("1.0.0");
            fixture.Repository.MakeACommit("+semver:minor");
            fixture.AssertFullSemver("1.1.0+1");

            fixture.ApplyTag("2.0.0");

            fixture.Repository.MakeACommit("Hello");

            // Default bump is patch

            fixture.AssertFullSemver("2.0.1+1");
        }
    }
开发者ID:qetza,项目名称:GitVersion,代码行数:18,代码来源:VersionBumpingScenarios.cs

示例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");
     }
 }
开发者ID:pascalberger,项目名称:GitVersion,代码行数:21,代码来源:DevelopScenarios.cs

示例9: 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");
        }
    }
开发者ID:onovotny,项目名称:GitVersion,代码行数:22,代码来源:ExecCmdLineArgumentTest.cs

示例10: MergedFeatureBranchesToMasterImpliesRelease

    public void MergedFeatureBranchesToMasterImpliesRelease()
    {
        using (var fixture = new EmptyRepositoryFixture())
        {
            fixture.Repository.MakeACommit("1");
            fixture.MakeATaggedCommit("1.0.0");

            fixture.BranchTo("feature/foo", "foo");
            fixture.MakeACommit("2");
            fixture.AssertFullSemver(config, "1.0.1-foo.1");
            fixture.MakeACommit("2.1");
            fixture.AssertFullSemver(config, "1.0.1-foo.2");
            fixture.Checkout("master");
            fixture.MergeNoFF("feature/foo");

            fixture.AssertFullSemver(config, "1.0.1");

            fixture.BranchTo("feature/foo2", "foo2");
            fixture.MakeACommit("3 +semver: minor");
            fixture.AssertFullSemver(config, "1.1.0-foo2.1");
            fixture.Checkout("master");
            fixture.MergeNoFF("feature/foo2");
            fixture.AssertFullSemver(config, "1.1.0");

            fixture.BranchTo("feature/foo3", "foo3");
            fixture.MakeACommit("4");
            fixture.Checkout("master");
            fixture.MergeNoFF("feature/foo3");
            fixture.SequenceDiagram.NoteOver("Merge message contains '+semver: minor'", "master");
            var commit = fixture.Repository.Head.Tip;
            // Put semver increment in merge message
            fixture.Repository.Commit(commit.Message + " +semver: minor", commit.Author, commit.Committer, new CommitOptions
            {
                AmendPreviousCommit = true
            });
            fixture.AssertFullSemver(config, "1.2.0");

            fixture.BranchTo("feature/foo4", "foo4");
            fixture.MakeACommit("5 +semver: major");
            fixture.AssertFullSemver(config, "2.0.0-foo4.1");
            fixture.Checkout("master");
            fixture.MergeNoFF("feature/foo4");
            fixture.AssertFullSemver(config, "2.0.0");

            // We should evaluate any commits not included in merge commit calculations for direct commit/push or squash to merge commits
            fixture.MakeACommit("6 +semver: major");
            fixture.AssertFullSemver(config, "3.0.0");
            fixture.MakeACommit("7 +semver: minor");
            fixture.AssertFullSemver(config, "3.1.0");
            fixture.MakeACommit("8");
            fixture.AssertFullSemver(config, "3.1.1");

            // Finally verify that the merge commits still function properly
            fixture.BranchTo("feature/foo5", "foo5");
            fixture.MakeACommit("9 +semver: minor");
            fixture.AssertFullSemver(config, "3.2.0-foo5.1");
            fixture.Checkout("master");
            fixture.MergeNoFF("feature/foo5");
            fixture.AssertFullSemver(config, "3.2.0");

            // One more direct commit for good measure
            fixture.MakeACommit("10 +semver: minor");
            fixture.AssertFullSemver(config, "3.3.0");
            // And we can commit without bumping semver
            fixture.MakeACommit("11 +semver: none");
            fixture.AssertFullSemver(config, "3.3.0");
            Console.WriteLine(fixture.SequenceDiagram.GetDiagram());
        }
    }
开发者ID:JakeGinnivan,项目名称:GitVersion,代码行数:69,代码来源:MainlineDevelopmentMode.cs

示例11: VerifyPullRequestsActLikeContinuousDelivery

    public void VerifyPullRequestsActLikeContinuousDelivery()
    {
        using (var fixture = new EmptyRepositoryFixture())
        {
            fixture.Repository.MakeACommit("1");
            fixture.MakeATaggedCommit("1.0.0");
            fixture.MakeACommit();
            fixture.AssertFullSemver(config, "1.0.1");

            fixture.BranchTo("feature/foo", "foo");
            fixture.MakeACommit();
            fixture.MakeACommit();
            fixture.Repository.CreatePullRequestRef("feature/foo", "master", normalise: true, prNumber: 8);
            fixture.AssertFullSemver(config, "1.0.2-PullRequest0008.3");
        }
    }
开发者ID:JakeGinnivan,项目名称:GitVersion,代码行数:16,代码来源:MainlineDevelopmentMode.cs

示例12: VerifyForwardMerge

    public void VerifyForwardMerge()
    {
        using (var fixture = new EmptyRepositoryFixture())
        {
            fixture.Repository.MakeACommit("1");
            fixture.MakeATaggedCommit("1.0.0");
            fixture.MakeACommit(); // 1.0.1

            fixture.BranchTo("feature/foo", "foo");
            fixture.MakeACommit();
            fixture.MakeACommit();
            fixture.AssertFullSemver(config, "1.0.2-foo.2");

            fixture.Checkout("master");
            fixture.MakeACommit();
            fixture.AssertFullSemver(config, "1.0.2");
            fixture.Checkout("feature/foo");
            fixture.MergeNoFF("master");
            fixture.AssertFullSemver(config, "1.0.3-foo.3");
        }
    }
开发者ID:JakeGinnivan,项目名称:GitVersion,代码行数:21,代码来源:MainlineDevelopmentMode.cs

示例13: SupportBranches

    public void SupportBranches()
    {
        using (var fixture = new EmptyRepositoryFixture())
        {
            fixture.Repository.MakeACommit("1");
            fixture.MakeATaggedCommit("1.0.0");
            fixture.MakeACommit(); // 1.0.1
            fixture.MakeACommit(); // 1.0.2
            fixture.AssertFullSemver(config, "1.0.2");

            fixture.BranchTo("support/1.0", "support10");
            fixture.AssertFullSemver(config, "1.0.3");

            // Move master on
            fixture.Checkout("master");
            fixture.MakeACommit("+semver: major"); // 2.0.0 (on master)
            fixture.AssertFullSemver(config, "2.0.0");

            // Continue on support/1.0
            fixture.Checkout("support/1.0");
            fixture.MakeACommit(); // 1.0.4
            fixture.MakeACommit(); // 1.0.5
            fixture.AssertFullSemver(config, "1.0.5");
            fixture.BranchTo("feature/foo", "foo");
            fixture.AssertFullSemver(config, "1.0.5-foo.0");
            fixture.MakeACommit();
            fixture.AssertFullSemver(config, "1.0.5-foo.1");
            fixture.MakeACommit();
            fixture.AssertFullSemver(config, "1.0.5-foo.2");
            fixture.Repository.CreatePullRequestRef("feature/foo", "support/1.0", normalise: true, prNumber: 7);
            fixture.AssertFullSemver(config, "1.0.5-PullRequest0007.3");
        }
    }
开发者ID:pascalberger,项目名称:GitVersion,代码行数:33,代码来源:MainlineDevelopmentMode.cs

示例14: VerifySupportForwardMerge

    public void VerifySupportForwardMerge()
    {
        using (var fixture = new EmptyRepositoryFixture())
        {
            fixture.Repository.MakeACommit("1");
            fixture.MakeATaggedCommit("1.0.0");
            fixture.MakeACommit(); // 1.0.1

            fixture.BranchTo("support/1.0", "support10");
            fixture.MakeACommit();
            fixture.MakeACommit();

            fixture.Checkout("master");
            fixture.MakeACommit("+semver: minor");
            fixture.AssertFullSemver(config, "1.1.0");
            fixture.MergeNoFF("support/1.0");
            fixture.AssertFullSemver(config, "1.1.1");
            fixture.MakeACommit();
            fixture.AssertFullSemver(config, "1.1.2");
            fixture.Checkout("support/1.0");
            fixture.AssertFullSemver(config, "1.0.4");

            fixture.BranchTo("feature/foo", "foo");
            fixture.MakeACommit();
            fixture.MakeACommit();
            fixture.AssertFullSemver(config, "1.0.4-foo.2"); // TODO This probably should be 1.0.5
        }
    }
开发者ID:pascalberger,项目名称:GitVersion,代码行数:28,代码来源:MainlineDevelopmentMode.cs

示例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");
        }
    }
开发者ID:pascalberger,项目名称:GitVersion,代码行数:22,代码来源:MainlineDevelopmentMode.cs


注:本文中的EmptyRepositoryFixture.MakeATaggedCommit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。