aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/revwalk
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/revwalk')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java24
2 files changed, 24 insertions, 10 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java
index 61a91e70dc..6854b6083d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java
@@ -98,14 +98,14 @@ class StartGenerator extends Generator {
} else {
pending = RevWalk.newDateRevQueue(q);
}
- if (rf != RevFilter.ALL && w.getRewriteParents()) {
- pendingOutputType |= HAS_REWRITE | NEEDS_REWRITE;
- }
if (tf != TreeFilter.ALL) {
+ int rewriteFlag;
if (w.getRewriteParents()) {
pendingOutputType |= HAS_REWRITE | NEEDS_REWRITE;
- }
- rf = AndRevFilter.create(new TreeRevFilter(w, tf), rf);
+ rewriteFlag = RevWalk.REWRITE;
+ } else
+ rewriteFlag = 0;
+ rf = AndRevFilter.create(new TreeRevFilter(w, tf, rewriteFlag), rf);
}
walker.queue = q;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java
index 4085954638..43571a6868 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/TreeRevFilter.java
@@ -60,8 +60,21 @@ public class TreeRevFilter extends RevFilter {
* Create a {@link org.eclipse.jgit.revwalk.filter.RevFilter} from a
* {@link org.eclipse.jgit.treewalk.filter.TreeFilter}.
*
- * When revWalk's rewrite parent flag is set, it creates a filter for the
- * first phase of a parent-rewriting limited revision walk.
+ * @param walker
+ * walker used for reading trees.
+ * @param t
+ * filter to compare against any changed paths in each commit. If
+ * a {@link org.eclipse.jgit.revwalk.FollowFilter}, will be
+ * replaced with a new filter following new paths after a rename.
+ * @since 3.5
+ */
+ public TreeRevFilter(RevWalk walker, TreeFilter t) {
+ this(walker, t, 0);
+ }
+
+ /**
+ * Create a filter for the first phase of a parent-rewriting limited
+ * revision walk.
* <p>
* This filter is ANDed to evaluate before all other filters and ties the
* configured {@link TreeFilter} into the revision walking process.
@@ -78,13 +91,14 @@ public class TreeRevFilter extends RevFilter {
* filter to compare against any changed paths in each commit. If
* a {@link FollowFilter}, will be replaced with a new filter
* following new paths after a rename.
- * @since 3.5
+ * @param rewriteFlag
+ * flag to color commits to be removed from the simplified DAT.
*/
- public TreeRevFilter(RevWalk walker, TreeFilter t) {
+ TreeRevFilter(RevWalk walker, TreeFilter t, int rewriteFlag) {
pathFilter = new TreeWalk(walker.reader);
pathFilter.setFilter(t);
pathFilter.setRecursive(t.shouldBeRecursive());
- this.rewriteFlag = walker.getRewriteParents() ? RevWalk.REWRITE : 0;
+ this.rewriteFlag = rewriteFlag;
}
@Override