aboutsummaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorDaniel Barkalow <barkalow@iabervon.org>2008-04-26 15:53:12 -0400
committerJunio C Hamano <gitster@pobox.com>2008-04-26 17:36:18 -0700
commitbe885d96fe0ebed47e637f3b0dd24fc5902f7081 (patch)
treeb4c0c29c4b58ffe95c7765ebd38e6089973d7b44 /http.c
parentc13b2633f49e3e61b37973204793a4d9ef981175 (diff)
downloadgit-be885d96fe0ebed47e637f3b0dd24fc5902f7081.tar.gz
git-be885d96fe0ebed47e637f3b0dd24fc5902f7081.tar.xz
Make ls-remote http://... list HEAD, like for git://...
This makes a struct ref able to represent a symref, and makes http.c able to recognize one, and makes transport.c look for "HEAD" as a ref in the list, and makes it dereference symrefs for the resulting ref, if any. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.c')
-rw-r--r--http.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/http.c b/http.c
index c8df13b8a..acf746a12 100644
--- a/http.c
+++ b/http.c
@@ -626,7 +626,10 @@ int http_fetch_ref(const char *base, struct ref *ref)
strbuf_rtrim(&buffer);
if (buffer.len == 40)
ret = get_sha1_hex(buffer.buf, ref->old_sha1);
- else
+ else if (!prefixcmp(buffer.buf, "ref: ")) {
+ ref->symref = xstrdup(buffer.buf + 5);
+ ret = 0;
+ } else
ret = 1;
} else {
ret = error("Couldn't get %s for %s\n%s",