aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src/org/eclipse
diff options
context:
space:
mode:
authorShawn Pearce <sop@google.com>2013-05-05 11:47:53 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2013-05-05 11:47:53 -0400
commita626f9fd66efa9653bf3292018a8dd3ac2be94e3 (patch)
tree5a601e3f3f95cec23d719a1cbbaedd6e26674449 /org.eclipse.jgit.pgm/src/org/eclipse
parente1c489530adba833e660306e578f10d8e2209d67 (diff)
parent0bdf030b26248c77806ababd757dad58f1344e57 (diff)
downloadjgit-a626f9fd66efa9653bf3292018a8dd3ac2be94e3.tar.gz
jgit-a626f9fd66efa9653bf3292018a8dd3ac2be94e3.zip
Merge "Require a DiffConfig when creating a FollowFilter"
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
index 8543dcb916..92a22b00b3 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java
@@ -50,6 +50,7 @@ import java.util.List;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;
+import org.eclipse.jgit.diff.DiffConfig;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
@@ -117,9 +118,7 @@ abstract class RevWalkTextBuiltin extends TextBuiltin {
}
@Option(name = "--follow", metaVar = "metaVar_path")
- void follow(final String path) {
- pathFilter = FollowFilter.create(path);
- }
+ private String followPath;
@Argument(index = 0, metaVar = "metaVar_commitish")
private final List<RevCommit> commits = new ArrayList<RevCommit>();
@@ -150,11 +149,14 @@ abstract class RevWalkTextBuiltin extends TextBuiltin {
for (final RevSort s : sorting)
walk.sort(s, true);
- if (pathFilter instanceof FollowFilter)
- walk.setTreeFilter(pathFilter);
- else if (pathFilter != TreeFilter.ALL)
+ if (pathFilter == TreeFilter.ALL) {
+ if (followPath != null)
+ walk.setTreeFilter(FollowFilter.create(followPath,
+ db.getConfig().get(DiffConfig.KEY)));
+ } else if (pathFilter != TreeFilter.ALL) {
walk.setTreeFilter(AndTreeFilter.create(pathFilter,
TreeFilter.ANY_DIFF));
+ }
if (revLimiter.size() == 1)
walk.setRevFilter(revLimiter.get(0));