X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=t%2Ft5512-ls-remote.sh;h=5c546c99a58854ae0f430e469dad525af52e9292;hb=ee646eb48f9a7fc6c225facf2b7449a8a65ef8f2;hp=d1912351db7da4a7c457fd44895b5ea076c84e7e;hpb=1125297ca1744be09f9e392aab0dd2c70d838583;p=git.git diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index d1912351d..5c546c99a 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