aboutsummaryrefslogtreecommitdiff
path: root/cache.h
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 /cache.h
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 'cache.h')
-rw-r--r--cache.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/cache.h b/cache.h
index 384b26022..1f128d55d 100644
--- a/cache.h
+++ b/cache.h
@@ -428,7 +428,7 @@ extern unsigned char* use_pack(struct packed_git *, struct pack_window **, off_t
extern void unuse_pack(struct pack_window **);
extern struct packed_git *add_packed_git(const char *, int, int);
extern uint32_t num_packed_objects(const struct packed_git *p);
-extern int nth_packed_object_sha1(const struct packed_git *, uint32_t, unsigned char*);
+extern const unsigned char *nth_packed_object_sha1(const struct packed_git *, uint32_t);
extern off_t find_pack_entry_one(const unsigned char *, struct packed_git *);
extern void *unpack_entry(struct packed_git *, off_t, enum object_type *, unsigned long *);
extern unsigned long unpack_object_header_gently(const unsigned char *buf, unsigned long len, enum object_type *type, unsigned long *sizep);