summaryrefslogtreecommitdiff
path: root/t/t5500-fetch-pack.sh
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2012-09-09 06:19:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-09-12 18:46:31 (GMT)
commit3b0820045a68fa84707768528f3af4520fbf3bf0 (patch)
treefa14a77dc9b7c9dfc6becda3dddfc2ae59a90078 /t/t5500-fetch-pack.sh
parent51f3145c2834c8f1d94c5b7cf3790baf74b9f521 (diff)
downloadgit-3b0820045a68fa84707768528f3af4520fbf3bf0.zip
git-3b0820045a68fa84707768528f3af4520fbf3bf0.tar.gz
git-3b0820045a68fa84707768528f3af4520fbf3bf0.tar.bz2
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>
Diffstat (limited to 't/t5500-fetch-pack.sh')
-rwxr-xr-xt/t5500-fetch-pack.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index e80a2af..6fa1cef 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -397,4 +397,34 @@ test_expect_success 'test duplicate refs from stdin' '
test_cmp expect actual
'
+test_expect_success 'set up tests of missing reference' '
+ cat >expect-error <<-\EOF
+ error: no such remote ref refs/heads/xyzzy
+ EOF
+'
+
+test_expect_failure '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_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_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_done