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


C# Repository.Blame方法代码示例

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


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

示例1: CanBlameFromVariousTypes

 public void CanBlameFromVariousTypes()
 {
     using (var repo = new Repository(BareTestRepoPath))
     {
         AssertCorrectHeadBlame(repo.Blame("README", new BlameOptions {StartingAt = "HEAD" }));
         AssertCorrectHeadBlame(repo.Blame("README", new BlameOptions {StartingAt = repo.Head }));
         AssertCorrectHeadBlame(repo.Blame("README", new BlameOptions {StartingAt = repo.Head.Tip }));
         AssertCorrectHeadBlame(repo.Blame("README", new BlameOptions {StartingAt = repo.Branches["master"]}));
     }
 }
开发者ID:AndersKroghDk,项目名称:libgit2sharp,代码行数:10,代码来源:BlameFixture.cs

示例2: CanBlameFromADifferentCommit

        public void CanBlameFromADifferentCommit()
        {
            using (var repo = new Repository(MergedTestRepoWorkingDirPath))
            {
                // File doesn't exist at HEAD
                Assert.Throws<LibGit2SharpException>(() => repo.Blame("ancestor-only.txt"));

                var blame = repo.Blame("ancestor-only.txt", new BlameOptions { StartingAt = "9107b30" });
                Assert.Equal(1, blame.Count());
            }
        }
开发者ID:AndersKroghDk,项目名称:libgit2sharp,代码行数:11,代码来源:BlameFixture.cs

示例3: CanBlameFromADifferentCommit

        public void CanBlameFromADifferentCommit()
        {
            string path = SandboxMergedTestRepo();
            using (var repo = new Repository(path))
            {
                // File doesn't exist at HEAD
                Assert.Throws<NotFoundException>(() => repo.Blame("ancestor-only.txt"));

                var blame = repo.Blame("ancestor-only.txt", new BlameOptions { StartingAt = "9107b30" });
                Assert.Equal(1, blame.Count());
            }
        }
开发者ID:beulah444,项目名称:libgit2sharp,代码行数:12,代码来源:BlameFixture.cs

示例4: CanBlameSimply

 public void CanBlameSimply()
 {
     using (var repo = new Repository(BareTestRepoPath))
     {
         AssertCorrectHeadBlame(repo.Blame("README"));
     }
 }
开发者ID:AndersKroghDk,项目名称:libgit2sharp,代码行数:7,代码来源:BlameFixture.cs

示例5: CanBlameSimply

 public void CanBlameSimply()
 {
     string path = SandboxBareTestRepo();
     using (var repo = new Repository(path))
     {
         AssertCorrectHeadBlame(repo.Blame("README"));
     }
 }
开发者ID:beulah444,项目名称:libgit2sharp,代码行数:8,代码来源:BlameFixture.cs

示例6: ValidatesLimits

        public void ValidatesLimits()
        {
            using (var repo = new Repository(BareTestRepoPath))
            {
                var blame = repo.Blame("README");

                Assert.Throws<ArgumentOutOfRangeException>(() => blame[1]);
                Assert.Throws<ArgumentOutOfRangeException>(() => blame.HunkForLine(2));
            }
        }
开发者ID:AndersKroghDk,项目名称:libgit2sharp,代码行数:10,代码来源:BlameFixture.cs

示例7: CanStopBlame

 public void CanStopBlame()
 {
     using (var repo = new Repository(BareTestRepoPath))
     {
         // $ git blame .\new.txt
         // 9fd738e8 (Scott Chacon 2010-05-24 10:19:19 -0700 1) my new file
         // (be3563a comes after 9fd738e8)
         var blame = repo.Blame("new.txt", new BlameOptions {StoppingAt = "be3563a"});
         Assert.True(blame[0].FinalCommit.Sha.StartsWith("be3563a"));
     }
 }
开发者ID:AndersKroghDk,项目名称:libgit2sharp,代码行数:11,代码来源:BlameFixture.cs


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