Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Compare index with HEAD

Hi,

 

The index does not necessarily contain any entries for trees. See [1]. This document says

that there are optional entries (extensions) which contain precomputed hashes for tree’s.

But they don’t have to be there. JGit will not write such extensions – native git may.  I asked

a similar question here [2].

 

Means: you really have to treewalk trough each and every file and see whether there are

differences.      

 

I would look into StatusCommand.call()->IndexDiff.diff() and check the code there. The code

you attached is ok. I would add a setRecursive(true). Then you don’t have to deal that while

walking you have to explicitly descend into subtrees.

 

Ciao

  Chris

 

 

[1] https://github.com/git/git/blob/master/Documentation/technical/index-format.txt

[2] http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg00381.html

 


Back to the top