t5500: add tests of error output for missing refs

If "git fetch-pack" is called with reference names that do not exist on the remote, then it should emit an error message error: no such remote ref refs/heads/xyzzy This is currently broken if *only* missing references are passed to "git fetch-pack". Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael Haggerty committed Sep 9, 2012 at 08:19 UTC 3b0820045a68fa84707768528f3af4520fbf3bf0
1 file changed +30
t/t5500-fetch-pack.sh
+30
@@ -397,4 +397,34 @@ test_expect_success 'test duplicate refs from stdin' '
397 test_cmp expect actual
398 '
399
400 +test_expect_success 'set up tests of missing reference' '
401 + cat >expect-error <<-\EOF
402 + error: no such remote ref refs/heads/xyzzy
403 + EOF
404 +'
405 +
406 +test_expect_failure 'test lonely missing ref' '
407 + (
408 + cd client &&
409 + test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy
410 + ) >/dev/null 2>error-m &&
411 + test_cmp expect-error error-m
412 +'
413 +
414 +test_expect_success 'test missing ref after existing' '
415 + (
416 + cd client &&
417 + test_must_fail git fetch-pack --no-progress .. refs/heads/A refs/heads/xyzzy
418 + ) >/dev/null 2>error-em &&
419 + test_cmp expect-error error-em
420 +'
421 +
422 +test_expect_success 'test missing ref before existing' '
423 + (
424 + cd client &&
425 + test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy refs/heads/A
426 + ) >/dev/null 2>error-me &&
427 + test_cmp expect-error error-me
428 +'
429 +
430 test_done