Get files modified/added/removed from a commit in LibGit2Sharp

后端 未结 1 1320
南方客
南方客 2020-12-10 03:58

I\'ve this method, where I get files from my last commit:

static void GetFiles(Tree t, String dir = "")
{
    foreach (TreeEntry treeEntry in t)
            


        
相关标签:
1条回答
  • 2020-12-10 04:21

    Because of how git store data in the file systems, a git commit is a snapshot of all the files contained in the commit. Then the Tree object return you the state of all the files of the repository.

    I think that you must do the diff between the tree of this commit and the tree of the previous one and I think it should be done with the method Repository.Diff.Compare()

    0 讨论(0)
提交回复
热议问题