From be885d96fe0ebed47e637f3b0dd24fc5902f7081 Mon Sep 17 00:00:00 2001 From: Daniel Barkalow Date: Sat, 26 Apr 2008 15:53:12 -0400 Subject: 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 Signed-off-by: Junio C Hamano --- http.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'http.c') 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", -- cgit v1.2.1