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:
Matt McCutchen
2017-02-22 11:01:22 -05:00
committed by Junio C Hamano
parent 3b9e3c2ced
commit e860d96bf8
4 changed files with 23 additions and 9 deletions

View File

@ -219,12 +219,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
* remote no-such-ref' would silently succeed without issuing
* an error.
*/
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;
}
ret |= report_unmatched_refs(sought, nr_sought);
while (ref) {
printf("%s %s\n",