summaryrefslogtreecommitdiff
path: root/builtin-pack-objects.c
diff options
context:
space:
mode:
authorMartin Koegler <mkoegler@auto.tuwien.ac.at>2007-05-28 23:20:57 +0200
committerJunio C Hamano <junkio@cox.net>2007-05-29 01:24:42 -0700
commita588d88aaff312f3afd5713ffcb4e4b1829fb5a6 (patch)
tree7f2deddfebded03b6b0f66ba78647e840f1b8218 /builtin-pack-objects.c
parent322bcd9a9a2c0081c66414bde64e0d443c9ec922 (diff)
downloadgit-a588d88aaff312f3afd5713ffcb4e4b1829fb5a6.tar.gz
builtin-pack-objects: don't fail, if delta is not possible
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 <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index e52332df99..17627b34e8 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);