diff options
author | Christian Halstrick <christian.halstrick@sap.com> | 2016-04-12 14:38:37 +0200 |
---|---|---|
committer | Christian Halstrick <christian.halstrick@sap.com> | 2016-04-22 09:32:34 +0200 |
commit | 22d7ec2971edf8d375c4fc9ef9d92526bad73626 (patch) | |
tree | a14c398c8b5316777ec4ffe53c86be857a77b1dd /org.eclipse.jgit/src/org/eclipse/jgit/dircache | |
parent | 80fa5f39f9d3b742e34b4baad019d917ff19f318 (diff) | |
download | jgit-22d7ec2971edf8d375c4fc9ef9d92526bad73626.tar.gz jgit-22d7ec2971edf8d375c4fc9ef9d92526bad73626.zip |
Fix calling of clean/smudge filters from Checkout,MergeCommands
When CheckoutCommand or MergeCommand is called then not in all situation
the treewalks have been prepared to support clean/smudge filters. Fix
this
Bug: 491505
Change-Id: Iab5608049221c46d06812552ab97299e44d59e64
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/dircache')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java index 3fcaa38395..fc4cc90937 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java @@ -280,8 +280,9 @@ public class DirCacheCheckout { addTree(walk, headCommitTree); addTree(walk, mergeCommitTree); - walk.addTree(new DirCacheBuildIterator(builder)); + int dciPos = walk.addTree(new DirCacheBuildIterator(builder)); walk.addTree(workingTree); + workingTree.setDirCacheIterator(walk, dciPos); while (walk.next()) { processEntry(walk.getTree(0, CanonicalTreeParser.class), @@ -320,8 +321,9 @@ public class DirCacheCheckout { walk = new NameConflictTreeWalk(repo); addTree(walk, mergeCommitTree); - walk.addTree(new DirCacheBuildIterator(builder)); + int dciPos = walk.addTree(new DirCacheBuildIterator(builder)); walk.addTree(workingTree); + workingTree.setDirCacheIterator(walk, dciPos); while (walk.next()) { processEntry(walk.getTree(0, CanonicalTreeParser.class), @@ -1093,8 +1095,10 @@ public class DirCacheCheckout { private boolean isModifiedSubtree_IndexWorkingtree(String path) throws CorruptObjectException, IOException { try (NameConflictTreeWalk tw = new NameConflictTreeWalk(repo)) { - tw.addTree(new DirCacheIterator(dc)); - tw.addTree(new FileTreeIterator(repo)); + int dciPos = tw.addTree(new DirCacheIterator(dc)); + FileTreeIterator fti = new FileTreeIterator(repo); + tw.addTree(fti); + fti.setDirCacheIterator(tw, dciPos); tw.setRecursive(true); tw.setFilter(PathFilter.create(path)); DirCacheIterator dcIt; |