diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-23 10:27:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-23 10:27:08 -0700 |
commit | 3c0ae619e68398fe83d647b8460b399767ec103f (patch) | |
tree | 4a1e47bedda3d6bdc28b45aeeda057cb0c911bb3 /t | |
parent | Merge branch 'mg/config-symbolic-constants' (diff) | |
parent | ls-remote: the --exit-code option reports "no matching refs" (diff) | |
download | tgif-3c0ae619e68398fe83d647b8460b399767ec103f.tar.xz |
Merge branch 'ms/ls-remote-exit-with-status'
* ms/ls-remote-exit-with-status:
ls-remote: the --exit-code option reports "no matching refs"
Diffstat (limited to 't')
-rwxr-xr-x | t/t5512-ls-remote.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index d1912351db..5c546c99a5 100755 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@ -123,4 +123,28 @@ test_expect_success 'confuses pattern as remote when no remote specified' ' ' +test_expect_success 'die with non-2 for wrong repository even with --exit-code' ' + git ls-remote --exit-code ./no-such-repository ;# not && + status=$? && + test $status != 2 && test $status != 0 +' + +test_expect_success 'Report success even when nothing matches' ' + git ls-remote other.git "refs/nsn/*" >actual && + >expect && + test_cmp expect actual +' + +test_expect_success 'Report no-match with --exit-code' ' + test_expect_code 2 git ls-remote --exit-code other.git "refs/nsn/*" >actual && + >expect && + test_cmp expect actual +' + +test_expect_success 'Report match with --exit-code' ' + git ls-remote --exit-code other.git "refs/tags/*" >actual && + git ls-remote . tags/mark >expect && + test_cmp expect actual +' + test_done |