Merge branch 'jk/fetch-reachability-error-fix'
Code clean-up and a fix for "git fetch" by an explicit object name (as opposed to fetching refs by name). * jk/fetch-reachability-error-fix: fetch: do not consider peeled tags as advertised tips remote.c: make singular free_ref() public fetch: use free_refs() pkt-line: prepare buffer before handling ERR packets upload-pack: send ERR packet for non-tip objects t5530: check protocol response for "not our ref" t5516: drop ok=sigpipe from unreachable-want tests
This commit is contained in:
16
fetch-pack.c
16
fetch-pack.c
@ -573,9 +573,14 @@ static void filter_refs(struct fetch_pack_args *args,
|
||||
next = ref->next;
|
||||
|
||||
if (starts_with(ref->name, "refs/") &&
|
||||
check_refname_format(ref->name, 0))
|
||||
; /* trash */
|
||||
else {
|
||||
check_refname_format(ref->name, 0)) {
|
||||
/*
|
||||
* trash or a peeled value; do not even add it to
|
||||
* unmatched list
|
||||
*/
|
||||
free_one_ref(ref);
|
||||
continue;
|
||||
} else {
|
||||
while (i < nr_sought) {
|
||||
int cmp = strcmp(ref->name, sought[i]->name);
|
||||
if (cmp < 0)
|
||||
@ -630,10 +635,7 @@ static void filter_refs(struct fetch_pack_args *args,
|
||||
}
|
||||
|
||||
oidset_clear(&tip_oids);
|
||||
for (ref = unmatched; ref; ref = next) {
|
||||
next = ref->next;
|
||||
free(ref);
|
||||
}
|
||||
free_refs(unmatched);
|
||||
|
||||
*refs = newlist;
|
||||
}
|
||||
|
Reference in New Issue
Block a user