fetch-pack: move code to report unmatched refs to a function
Prepare to reuse this code in transport.c for "git fetch". While we're here, internationalize the existing error message. Signed-off-by: Matt McCutchen <matt@mattmccutchen.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
3b9e3c2ced
commit
e860d96bf8
13
fetch-pack.c
13
fetch-pack.c
@ -1094,3 +1094,16 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
|
||||
clear_shallow_info(&si);
|
||||
return ref_cpy;
|
||||
}
|
||||
|
||||
int report_unmatched_refs(struct ref **sought, int nr_sought)
|
||||
{
|
||||
int i, ret = 0;
|
||||
|
||||
for (i = 0; i < nr_sought; i++) {
|
||||
if (!sought[i] || sought[i]->matched)
|
||||
continue;
|
||||
error(_("no such remote ref %s"), sought[i]->name);
|
||||
ret = 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user