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

@ -484,7 +484,7 @@ test_expect_success 'test lonely missing ref' '
cd client &&
test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy
) >/dev/null 2>error-m &&
test_cmp expect-error error-m
test_i18ncmp expect-error error-m
'
test_expect_success 'test missing ref after existing' '
@ -492,7 +492,7 @@ test_expect_success 'test missing ref after existing' '
cd client &&
test_must_fail git fetch-pack --no-progress .. refs/heads/A refs/heads/xyzzy
) >/dev/null 2>error-em &&
test_cmp expect-error error-em
test_i18ncmp expect-error error-em
'
test_expect_success 'test missing ref before existing' '
@ -500,7 +500,7 @@ test_expect_success 'test missing ref before existing' '
cd client &&
test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy refs/heads/A
) >/dev/null 2>error-me &&
test_cmp expect-error error-me
test_i18ncmp expect-error error-me
'
test_expect_success 'test --all, --depth, and explicit head' '