aboutsummaryrefslogtreecommitdiff
path: root/builtin-pack-objects.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-04-04 16:49:04 -0400
committerJunio C Hamano <junkio@cox.net>2007-04-05 14:59:47 -0700
commitd72308e01c5977177cda0aed06cfeee9192e1247 (patch)
treec42895d515c9bdae4d429ddd93c74b2f082fe09d /builtin-pack-objects.c
parentd5ad36fe3584551a09160edce3e76d559d412ae5 (diff)
downloadgit-d72308e01c5977177cda0aed06cfeee9192e1247.tar.gz
git-d72308e01c5977177cda0aed06cfeee9192e1247.tar.xz
clean up and optimize nth_packed_object_sha1() usage
Let's avoid the open coded pack index reference in pack-object and use nth_packed_object_sha1() instead. This will help encapsulating index format differences in one place. And while at it there is no reason to copy SHA1's over and over while a direct pointer to it in the index will do just fine. Signed-off-by: Nicolas Pitre <nico@cam.org> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index b5f9648e8..45ac3e482 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -222,7 +222,7 @@ static const unsigned char *find_packed_object_name(struct packed_git *p,
off_t ofs)
{
struct revindex_entry *entry = find_packed_object(p, ofs);
- return ((unsigned char *)p->index_data) + 4 * 256 + 24 * entry->nr + 4;
+ return nth_packed_object_sha1(p, entry->nr);
}
static void *delta_against(void *buf, unsigned long size, struct object_entry *entry)