问题
How can i get the following information after a git-pull with libgit2sharp:
- Which files has been moved
- Which files has been created
- Which files has been deleted
The git-pull request it self works perfectly:
var result = repo.Network.Pull(new LibGit2Sharp.Signature("admin", "mail@......net", new DateTimeOffset(DateTime.Now)), options);
I already looked at the result of the Pull
-Method, but this seems not to contain the needed information.
Thank you very much!
回答1:
The MergeResult
type exposes a Commit
property which is not null when the merge was successful.
In order to find out what files have changed, one just have to leverage the repo.Diff.Compare()
method to compare this Commit
with its first parent.
来源:https://stackoverflow.com/questions/30758362/libgit2sharp-get-repository-changes-after-pull