Thread (6 messages) flat view 6 messages, 4 authors, 2016-06-15
DORMANTno replies

[PATCH 1/3] builtin-pack-objects: don't fail, if delta is not possible

From: Martin Koegler <hidden>
Date: 2016-06-15 22:43:13
Subsystem: the rest · Maintainer: Linus Torvalds

If builtin-pack-objects runs out of memory while finding
the best deltas, it bails out with an error.

If the delta index creation fails (because there is not enough memory),
we can downgrade the error message to a warning and continue with the
next object.

Signed-off-by: Martin Koegler <redacted>
---
The patches apply on top of next.

 builtin-pack-objects.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index e52332d..17627b3 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1454,8 +1454,12 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
 	}
 	if (!src->index) {
 		src->index = create_delta_index(src->data, src_size);
-		if (!src->index)
-			die("out of memory");
+		if (!src->index) {
+			static int warned = 0;
+			if (!warned++)
+				warning("suboptimal pack - out of memory");
+			return 0;
+		}
 	}
 
 	delta_buf = create_delta(src->index, trg->data, trg_size, &delta_size, max_size);
-- 
1.5.2.846.g9a144
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help