diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2011-02-07 16:30:49 -0800 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2011-02-13 13:43:11 -0800 |
commit | 24c1c530db67d56cfad9713ac59354d067421231 (patch) | |
tree | add908feb32fa9bc32ce21d287c3ebf8f5bcea72 /org.eclipse.jgit.test/tst/org/eclipse | |
parent | bc1af8459e048ff7a1c25ec6614c6a35520158b8 (diff) | |
download | jgit-24c1c530db67d56cfad9713ac59354d067421231.tar.gz jgit-24c1c530db67d56cfad9713ac59354d067421231.zip |
RevWalk: Avoid unnecessary re-parsing of commit bodies
If the RevFilter doesn't actually require the commit body,
we shouldn't reparse it if the body was disposed. This happens
often inside of UploadPack during common ancestor negotation, the
RevWalk is reset and re-run over roughly the same commit space,
but the bodies are discarded because the commit message is not
relevant to the process.
Change-Id: I87b6b6a5fb269669867047698abf718d366bd002
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFilterTest.java | 5 | ||||
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkResetTest.java | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFilterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFilterTest.java index dd67a9833a..643ba26d9a 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFilterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFilterTest.java @@ -312,5 +312,10 @@ public class RevWalkFilterTest extends RevWalkTestCase { IncorrectObjectTypeException, IOException { return true; } + + @Override + public boolean requiresCommitBody() { + return false; + } } } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkResetTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkResetTest.java index 27bd1a91ae..7cc5a32726 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkResetTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkResetTest.java @@ -81,6 +81,10 @@ public class RevWalkResetTest extends RevWalkTestCase { return this; } + @Override + public boolean requiresCommitBody() { + return true; + } }; // Do an initial run through the walk |