本文整理汇总了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"]}));
}
}
示例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());
}
}
示例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());
}
}
示例4: CanBlameSimply
public void CanBlameSimply()
{
using (var repo = new Repository(BareTestRepoPath))
{
AssertCorrectHeadBlame(repo.Blame("README"));
}
}
示例5: CanBlameSimply
public void CanBlameSimply()
{
string path = SandboxBareTestRepo();
using (var repo = new Repository(path))
{
AssertCorrectHeadBlame(repo.Blame("README"));
}
}
示例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));
}
}
示例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"));
}
}