From ca8db1424d1808a1f78bc9905efd267f7c154d8e Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 25 Sep 2005 09:59:37 -0700 Subject: [PATCH] Allow reading "symbolic refs" that point to other refs This extends the ref reading to understand a "symbolic ref": a ref file that starts with "ref: " and points to another ref file, and thus introduces the notion of ref aliases. This is in preparation of allowing HEAD to eventually not be a symlink, but one of these symbolic refs instead. [jc: Linus originally required the prefix to be "ref: " five bytes and nothing else, but I changed it to allow and strip any number of leading whitespaces to match what update-ref.c does.] Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- cache.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cache.h') diff --git a/cache.h b/cache.h index b8e3d9bfac..958c96e14d 100644 --- a/cache.h +++ b/cache.h @@ -229,6 +229,7 @@ extern int has_pack_index(const unsigned char *sha1); extern int get_sha1(const char *str, unsigned char *sha1); extern int get_sha1_hex(const char *hex, unsigned char *sha1); extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */ +extern int read_ref(const char *filename, unsigned char *sha1); /* General helper functions */ extern void usage(const char *err) NORETURN; -- cgit v1.2.1