summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2099bca)
raw | patch | inline | side by side (parent: 2099bca)
author | Nicolas Pitre <nico@cam.org> | |
Sat, 8 Dec 2007 01:27:52 +0000 (20:27 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 8 Dec 2007 11:38:35 +0000 (03:38 -0800) |
The wrong value was substracted from delta_cache_size when replacing
a cached delta, as trg_entry->delta_size was used after the old size
had been replaced by the new size.
Noticed by Linus.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
a cached delta, as trg_entry->delta_size was used after the old size
had been replaced by the new size.
Noticed by Linus.
Signed-off-by: Nicolas Pitre <nico@cam.org>
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 4f446588ac9ce9d8aa50d0c288817a16855422e6..350ece4d2a5b7c378f8fb5799ace58f7b030e528 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
}
}
- trg_entry->delta = src_entry;
- trg_entry->delta_size = delta_size;
- trg->depth = src->depth + 1;
-
/*
* Handle memory allocation outside of the cache
* accounting lock. Compiler will optimize the strangeness
trg_entry->delta_data = NULL;
}
if (delta_cacheable(src_size, trg_size, delta_size)) {
- delta_cache_size += trg_entry->delta_size;
+ delta_cache_size += delta_size;
cache_unlock();
trg_entry->delta_data = xrealloc(delta_buf, delta_size);
} else {
free(delta_buf);
}
+ trg_entry->delta = src_entry;
+ trg_entry->delta_size = delta_size;
+ trg->depth = src->depth + 1;
+
return 1;
}