]> source.dussan.org Git - jgit.git/commit
Support creating the working directory difference 91/1491/2
authorShawn O. Pearce <spearce@spearce.org>
Wed, 1 Sep 2010 19:30:11 +0000 (12:30 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 2 Sep 2010 18:38:39 +0000 (11:38 -0700)
commit59a262d5d27136fa87795feffc7ca029877a2bca
tree2679925a1ec91c16f2e24d0fd88305c2083d38f6
parent6f00a3e651e91592e2eb4f239b243a0aa2fe4610
Support creating the working directory difference

If the iterators passed into a diff formatter are working tree
iterators, we should enable ignoring files that are ignored, as
well as actually pull up the current content from the working tree
rather than getting it from the repository.

Because we abstract away the working directory access logic,
we can now actually support rename detection between the working
directory and the local repository when using a DiffFormatter.
This means its possible for an application to show an unstaged
delete-add pair as a rename if the add path is not ignored.
(Because the ignored file wouldn't show up in our difference output.)

Even more interesting is we can now do rename detection between any
two working trees, if both input iterators are WorkingTreeIterators.

Unfortunately we don't (yet) optimize for comparing the working
tree with the index involved so we can take advantage of cached
stat data to rule out non-dirty paths.

Change-Id: I4c0598afe48d8f99257266bf447a0ecd23ca7f5e
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/diff/ContentSource.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffEntry.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java