以编程方式在C#中执行"Git blame -w"

JYL*_*JYL 7 c# git libgit2 libgit2sharp git-blame

我需要以编程方式使用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
Run Code Online (Sandbox Code Playgroud)

但这相当于命令

git blame <file>

事实上我需要

git blame -w <file> (比较时忽略空格)

Libgit2sharp不设置-w开关,也不提供任何参数/选项来设置它.我有什么选择?你知道其他任何与命令-w切换兼容的库blame吗?

rob*_*ich 4

当我遇到 git lib 无法剪切的类似高级场景时,我只是使用 start process 来处理真正的 git 命令行。它并不性感,但非常有效。