]> source.dussan.org Git - jgit.git/commitdiff
Don't set REWRITE flag unless parent rewriting is requested 47/28447/1
authorDave Borowitz <dborowitz@google.com>
Thu, 12 Jun 2014 19:01:48 +0000 (12:01 -0700)
committerDave Borowitz <dborowitz@google.com>
Thu, 12 Jun 2014 20:52:09 +0000 (13:52 -0700)
Change-Id: I65e3702ceb6c8854a2c358cfc2c2e3a9fb9486ff

org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java

index aab678cd7b000434bfc9a37389071a10501b3c69..593e09e2551e9c125d04f1ce4a48d1e28e7af0a8 100644 (file)
@@ -127,11 +127,13 @@ class StartGenerator extends Generator {
                else
                        pending = new DateRevQueue(q);
                if (tf != TreeFilter.ALL) {
-                       rf = AndRevFilter.create(
-                                       new TreeRevFilter(w, tf, RevWalk.REWRITE), rf);
-                       pendingOutputType |= HAS_REWRITE;
-                       if (w.getRewriteParents())
-                               pendingOutputType |= NEEDS_REWRITE;
+                       int rewriteFlag;
+                       if (w.getRewriteParents()) {
+                               pendingOutputType |= HAS_REWRITE | NEEDS_REWRITE;
+                               rewriteFlag = RevWalk.REWRITE;
+                       } else
+                               rewriteFlag = 0;
+                       rf = AndRevFilter.create(new TreeRevFilter(w, tf, rewriteFlag), rf);
                }
 
                walker.queue = q;