From 32d462cea80cd52b2c3fa0d538aba7fcf079ba77 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Mon, 22 Apr 2013 21:52:32 +0200 Subject: pack-refs: merge code from pack-refs.{c,h} into refs.{c,h} pack-refs.c doesn't contain much code, and the code it does contain is closely related to reference handling. Moreover, there is some duplication between pack_refs() and repack_without_ref(). Therefore, merge pack-refs.c into refs.c and pack-refs.h into refs.h. The code duplication will be addressed in future commits. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'refs.h') diff --git a/refs.h b/refs.h index 3fc97a2e4a..175b7a92d1 100644 --- a/refs.h +++ b/refs.h @@ -72,6 +72,20 @@ extern void warn_dangling_symref(FILE *fp, const char *msg_fmt, const char *refn */ extern void add_packed_ref(const char *refname, const unsigned char *sha1); +/* + * Flags for controlling behaviour of pack_refs() + * PACK_REFS_PRUNE: Prune loose refs after packing + * PACK_REFS_ALL: Pack _all_ refs, not just tags and already packed refs + */ +#define PACK_REFS_PRUNE 0x0001 +#define PACK_REFS_ALL 0x0002 + +/* + * Write a packed-refs file for the current repository. + * flags: Combination of the above PACK_REFS_* flags. + */ +int pack_refs(unsigned int flags); + extern int ref_exists(const char *); /* -- cgit v1.2.3