我需要使用 C# 以编程方式获取 Git 历史中特定行的最后一位作者。我尝试使用libgit2sharp:
var repo = new LibGit2Sharp.Repository(gitRepositoryPath);
string relativePath = MakeRelativeSimple(filename);
var blameHunks = repo.Blame(relativePath);
// next : find the hunk which overlap the desired line number
但这相当于命令
git blame <file>
事实上我需要
git blame -w <file>
(比较时忽略空格)
Libgit2sharp不设置-w
开关,也不提供任何参数/选项来设置它。我有什么选择?您知道与命令-w
开关兼容的任何其他库吗?blame