From 9a217f2a725b085982e57b2a900d46128713cb27 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 28 Jun 2005 14:56:57 -0700 Subject: [PATCH] Expose packed_git and alt_odb. The commands git-fsck-cache and probably git-*-pull needs to have a way to enumerate objects contained in packed GIT archives and alternate object pools. This commit exposes the data structure used to keep track of them from sha1_file.c, and adds a couple of accessor interface functions for use by the enhanced git-fsck-cache command. Signed-off-by: Junio C Hamano Signed-off-by: Linus Torvalds --- cache.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'cache.h') diff --git a/cache.h b/cache.h index 383fc8664..9bfcdb641 100644 --- a/cache.h +++ b/cache.h @@ -233,4 +233,23 @@ struct checkout { extern int checkout_entry(struct cache_entry *ce, struct checkout *state); +extern struct alternate_object_database { + char *base; + char *name; +} *alt_odb; +extern void prepare_alt_odb(void); + +extern struct packed_git { + struct packed_git *next; + unsigned long index_size; + unsigned long pack_size; + unsigned int *index_base; + void *pack_base; + unsigned int pack_last_used; + char pack_name[0]; /* something like ".git/objects/pack/xxxxx.pack" */ +} *packed_git; +extern void prepare_packed_git(void); +extern int num_packed_objects(const struct packed_git *p); +extern int nth_packed_object_sha1(const struct packed_git *, int, unsigned char*); + #endif /* CACHE_H */ -- cgit v1.2.1