summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-09-25 16:59:37 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-10-02 06:19:32 (GMT)
commitca8db1424d1808a1f78bc9905efd267f7c154d8e (patch)
treefc2086ca262fc07a0da736b5a46f872b9ecc9cda /cache.h
parent9b143c6e155a8eead165b2a813b533e0f3e0018a (diff)
downloadgit-ca8db1424d1808a1f78bc9905efd267f7c154d8e.zip
git-ca8db1424d1808a1f78bc9905efd267f7c154d8e.tar.gz
git-ca8db1424d1808a1f78bc9905efd267f7c154d8e.tar.bz2
[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 <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index b8e3d9b..958c96e 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;