aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2020-07-17 19:41:31 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2022-03-06 11:11:26 +0100
commit72ae234e79aca7f3f6a5e78e3c9c9ac6a127bba9 (patch)
tree7a5a43e614a63d492c7a36040c1bbbfc6a34b1b9 /org.eclipse.jgit/src/org
parent46d58b84c9170ce6021c8adfdb900b0283772829 (diff)
downloadjgit-72ae234e79aca7f3f6a5e78e3c9c9ac6a127bba9.tar.gz
jgit-72ae234e79aca7f3f6a5e78e3c9c9ac6a127bba9.zip
IndexDiff: use tree filter also for SubmoduleWalk
The only uses of IndexDiff.setFilter() in JGit and EGit set a path filter. Passing the filter on to the SubmoduleWalk gives the desired result, which is consistent with command-line git. Bug: 565251 Change-Id: I8eca1ed73eb1d237b8785f369352f72af9e0e168 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit/src/org')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
index 28ea927b14..df9fd47efa 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
@@ -568,6 +568,9 @@ public class IndexDiff {
if (ignoreSubmoduleMode != IgnoreSubmoduleMode.ALL) {
try (SubmoduleWalk smw = new SubmoduleWalk(repository)) {
smw.setTree(new DirCacheIterator(dirCache));
+ if (filter != null) {
+ smw.setFilter(filter);
+ }
smw.setBuilderFactory(factory);
while (smw.next()) {
IgnoreSubmoduleMode localIgnoreSubmoduleMode = ignoreSubmoduleMode;