]> source.dussan.org Git - jgit.git/commitdiff
Do not enforce DeltaWindow maxMemory when zero. 87/9387/1
authorColby Ranger <cranger@google.com>
Thu, 27 Dec 2012 19:21:20 +0000 (11:21 -0800)
committerColby Ranger <cranger@google.com>
Thu, 27 Dec 2012 19:22:35 +0000 (11:22 -0800)
The maxMemory for a DeltaWindow can be optionally disabled when it is
less than or equal to zero. Respect this configuration when enforcing
the limits on object load.

Change-Id: Ic0f4ffcabf82105f8e690bd0eb5e6be485a313b3

org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaWindow.java

index b440774bc6e879c78b5ddcc004ed3b68b7c17500..2f1878891585ff2885af9ecbe8913c69177037b2 100644 (file)
@@ -460,6 +460,9 @@ class DeltaWindow {
        }
 
        private void checkLoadable(DeltaWindowEntry ent, long need) {
+               if (maxMemory <= 0)
+                       return;
+
                int tail = next(resSlot);
                while (maxMemory < loaded + need) {
                        DeltaWindowEntry cur = window[tail];