From 7eb0b702fdcbf82ed540c21c37e1e2b441daf09e Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Thu, 12 Jun 2014 12:01:48 -0700 Subject: [PATCH] Don't set REWRITE flag unless parent rewriting is requested Change-Id: I65e3702ceb6c8854a2c358cfc2c2e3a9fb9486ff --- .../src/org/eclipse/jgit/revwalk/StartGenerator.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 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 aab678cd7b..593e09e255 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/StartGenerator.java @@ -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; -- 2.39.5