]> source.dussan.org Git - jgit.git/commitdiff
Discard object bodies when checking connectivity 44/1544/1
authorShawn O. Pearce <spearce@spearce.org>
Mon, 6 Sep 2010 18:36:08 +0000 (11:36 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 6 Sep 2010 18:36:08 +0000 (11:36 -0700)
Since we are only checking the links between objects we don't need
to hold onto commit messages after their headers have been parsed
by the walker.  Dropping them saves a bit of memory, which is always
good when accepting huge pack files.

Change-Id: I378920409b6acf04a35cdf24f81567b1ce030e36
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java

index 53a3841173e4ef4ca93deaaf71aa12ce7cde0cc3..36ee2fedf61fb5894af2095560e742bbb2fc16c3 100644 (file)
@@ -810,6 +810,8 @@ public class ReceivePack {
                ip = null;
 
                final ObjectWalk ow = new ObjectWalk(db);
+               ow.setRetainBody(false);
+
                for (final ReceiveCommand cmd : commands) {
                        if (cmd.getResult() != Result.NOT_ATTEMPTED)
                                continue;