summaryrefslogtreecommitdiff
path: root/remote.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 /remote.c
parenta064ac1bc3f13103f92ae198da7fc44a1452c89d (diff)
parentbe885d96fe0ebed47e637f3b0dd24fc5902f7081 (diff)
downloadgit-31a3c6bb45aa61e45f1663871620eaf742f0abbb.tar.gz
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 'remote.c')
-rw-r--r--remote.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/remote.c b/remote.c
index 870d224a39..6b480cbb98 100644
--- a/remote.c
+++ b/remote.c
@@ -711,13 +711,22 @@ struct ref *copy_ref_list(const struct ref *ref)
return ret;
}
+void free_ref(struct ref *ref)
+{
+ if (!ref)
+ return;
+ free(ref->remote_status);
+ free(ref->symref);
+ free(ref);
+}
+
void free_refs(struct ref *ref)
{
struct ref *next;
while (ref) {
next = ref->next;
free(ref->peer_ref);
- free(ref);
+ free_ref(ref);
ref = next;
}
}
@@ -1177,3 +1186,15 @@ int get_fetch_map(const struct ref *remote_refs,
return 0;
}
+
+int resolve_remote_symref(struct ref *ref, struct ref *list)
+{
+ if (!ref->symref)
+ return 0;
+ for (; list; list = list->next)
+ if (!strcmp(ref->symref, list->name)) {
+ hashcpy(ref->old_sha1, list->old_sha1);
+ return 0;
+ }
+ return 1;
+}