Skip to content

Commit 3b08200

Browse files
mhaggergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 51f3145 commit 3b08200

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

t/t5500-fetch-pack.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,4 +397,34 @@ test_expect_success 'test duplicate refs from stdin' '
397397
test_cmp expect actual
398398
'
399399

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+
400430
test_done

0 commit comments

Comments
 (0)