Store peeled refs in packed-refs file.

This would speed up "show-ref -d" in a repository with mostly
packed tags.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano
2006-11-19 13:22:44 -08:00
parent ef06b91804
commit cf0adba788
4 changed files with 117 additions and 20 deletions

4
refs.h
View File

@ -16,6 +16,8 @@ struct ref_lock {
*/
#define REF_ISSYMREF 01
#define REF_ISPACKED 02
#define REF_ISPEELED 04 /* internal use */
typedef int each_ref_fn(const char *refname, const unsigned char *sha1, int flags, void *cb_data);
extern int head_ref(each_ref_fn, void *);
extern int for_each_ref(each_ref_fn, void *);
@ -23,6 +25,8 @@ extern int for_each_tag_ref(each_ref_fn, void *);
extern int for_each_branch_ref(each_ref_fn, void *);
extern int for_each_remote_ref(each_ref_fn, void *);
extern int peel_ref(const char *, unsigned char *);
/** Reads the refs file specified into sha1 **/
extern int get_ref_sha1(const char *ref, unsigned char *sha1);