summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-06-28 21:56:57 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-28 22:16:25 (GMT)
commit9a217f2a725b085982e57b2a900d46128713cb27 (patch)
tree7a8e6944274ba9653b56e523aa6c5b185e46f051 /cache.h
parentd22b9290ab6de119d03154844910ae5d963b5f1f (diff)
downloadgit-9a217f2a725b085982e57b2a900d46128713cb27.zip
git-9a217f2a725b085982e57b2a900d46128713cb27.tar.gz
git-9a217f2a725b085982e57b2a900d46128713cb27.tar.bz2
[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 <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 383fc86..9bfcdb6 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 */