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", "[email protected]", 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!
The
MergeResult
type exposes aCommit
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 thisCommit
with its first parent.