aboutsummaryrefslogtreecommitdiff
path: root/builtin-pack-objects.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2006-09-21 00:05:37 -0400
committerJunio C Hamano <junkio@cox.net>2006-09-23 01:51:33 -0700
commit43057304c0bbaf7bc7511daaf81df08c7909a90b (patch)
treecd6fa0d7aea39d7a3f5e9b1f37e123ec348f045a /builtin-pack-objects.c
parent16854571aae6302f457c5fbee41ac64669b09595 (diff)
downloadgit-43057304c0bbaf7bc7511daaf81df08c7909a90b.tar.gz
git-43057304c0bbaf7bc7511daaf81df08c7909a90b.tar.xz
many cleanups to sha1_file.c
Those cleanups are mainly to set the table for the support of deltas with base objects referenced by offsets instead of sha1. This means that many pack lookup functions are converted to take a pack/offset tuple instead of a sha1. This eliminates many struct pack_entry usages since this structure carried redundent information in many cases, and it increased stack footprint needlessly for a couple recursively called functions that used to declare a local copy of it for every recursion loop. In the process, packed_object_info_detail() has been reorganized as well so to look much saner and more amenable to deltas with offset support. Finally the appropriate adjustments have been made to functions that depend on the above changes. But there is no functionality changes yet simply some code refactoring at this point. Signed-off-by: Nicolas Pitre <nico@cam.org> 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, 4 insertions, 4 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 8d7a1209d..96c069a81 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -597,15 +597,15 @@ static int add_object_entry(const unsigned char *sha1, unsigned hash, int exclud
if (!exclude) {
for (p = packed_git; p; p = p->next) {
- struct pack_entry e;
- if (find_pack_entry_one(sha1, &e, p)) {
+ unsigned long offset = find_pack_entry_one(sha1, p);
+ if (offset) {
if (incremental)
return 0;
if (local && !p->pack_local)
return 0;
if (!found_pack) {
- found_offset = e.offset;
- found_pack = e.p;
+ found_offset = offset;
+ found_pack = p;
}
}
}