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.
This commit is contained in:
23
remote.c
23
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user