aboutsummaryrefslogtreecommitdiff
path: root/walker.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-08 20:06:23 -0700
committerJunio C Hamano <gitster@pobox.com>2008-05-08 20:06:23 -0700
commit31a3c6bb45aa61e45f1663871620eaf742f0abbb (patch)
tree5d3fcd7f35999e519a3df485f1c61e9f2c2fed80 /walker.c
parenta064ac1bc3f13103f92ae198da7fc44a1452c89d (diff)
parentbe885d96fe0ebed47e637f3b0dd24fc5902f7081 (diff)
downloadgit-31a3c6bb45aa61e45f1663871620eaf742f0abbb.tar.gz
git-31a3c6bb45aa61e45f1663871620eaf742f0abbb.tar.xz
Merge branch 'db/learn-HEAD'
* db/learn-HEAD: Make ls-remote http://... list HEAD, like for git://... Make walker.fetch_ref() take a struct ref.
Diffstat (limited to 'walker.c')
-rw-r--r--walker.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/walker.c b/walker.c
index c10eca882..fa96a7c7d 100644
--- a/walker.c
+++ b/walker.c
@@ -190,9 +190,14 @@ static int interpret_target(struct walker *walker, char *target, unsigned char *
if (!get_sha1_hex(target, sha1))
return 0;
if (!check_ref_format(target)) {
- if (!walker->fetch_ref(walker, target, sha1)) {
+ struct ref *ref = alloc_ref(strlen(target));
+ strcpy(ref->name, target);
+ if (!walker->fetch_ref(walker, ref)) {
+ hashcpy(sha1, ref->old_sha1);
+ free(ref);
return 0;
}
+ free(ref);
}
return -1;
}