summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 538cf6b)
raw | patch | inline | side by side (parent: 538cf6b)
author | Nicolas Pitre <nico@cam.org> | |
Wed, 29 Oct 2008 23:02:52 +0000 (19:02 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 2 Nov 2008 23:22:35 +0000 (15:22 -0800) |
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-pack-objects.c | patch | blob | history |
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 5be6664c7294157c669e1b73de4698e81655d460..1b6eff314e527fdcc5cd1f1ebe9fefd15e9822ff 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
dheader[pos] = ofs & 127;
while (ofs >>= 7)
dheader[--pos] = 128 | (--ofs & 127);
- if (limit && hdrlen + sizeof(dheader) - pos + datalen + 20 >= limit)
+ if (limit && hdrlen + sizeof(dheader) - pos + datalen + 20 >= limit) {
+ unuse_pack(&w_curs);
return 0;
+ }
sha1write(f, header, hdrlen);
sha1write(f, dheader + pos, sizeof(dheader) - pos);
hdrlen += sizeof(dheader) - pos;
reused_delta++;
} else if (type == OBJ_REF_DELTA) {
- if (limit && hdrlen + 20 + datalen + 20 >= limit)
+ if (limit && hdrlen + 20 + datalen + 20 >= limit) {
+ unuse_pack(&w_curs);
return 0;
+ }
sha1write(f, header, hdrlen);
sha1write(f, entry->delta->idx.sha1, 20);
hdrlen += 20;
reused_delta++;
} else {
- if (limit && hdrlen + datalen + 20 >= limit)
+ if (limit && hdrlen + datalen + 20 >= limit) {
+ unuse_pack(&w_curs);
return 0;
+ }
sha1write(f, header, hdrlen);
}
copy_pack_data(f, p, &w_curs, offset, datalen);