From d492b31cafe9aa5ce001b1d48815f4c0bb40d01a Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Sat, 12 Jul 2008 17:47:52 +0200 Subject: t/: Use "test_must_fail git" instead of "! git" This patch changes every occurrence of "! git" -- with the meaning that a git call has to gracefully fail -- into "test_must_fail git". This is useful to - make sure the test does not fail because of a signal, e.g. SIGSEGV, and - advertise the use of "test_must_fail" for new tests. Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano --- t/t5505-remote.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 't/t5505-remote.sh') diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index 1e192a2207..be9ee9326f 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -164,7 +164,7 @@ test_expect_success 'prune' ' git fetch origin && git remote prune origin && git rev-parse refs/remotes/origin/side2 && - ! git rev-parse refs/remotes/origin/side) + test_must_fail git rev-parse refs/remotes/origin/side) ' cat > test/expect << EOF @@ -179,7 +179,7 @@ test_expect_success 'prune --dry-run' ' (cd test && git remote prune --dry-run origin > output && git rev-parse refs/remotes/origin/side2 && - ! git rev-parse refs/remotes/origin/side && + test_must_fail git rev-parse refs/remotes/origin/side && (cd ../one && git branch -m side side2) && test_cmp expect output) @@ -194,10 +194,10 @@ test_expect_success 'add --mirror && prune' ' git branch -m side2 side) && (cd mirror && git rev-parse --verify refs/heads/side2 && - ! git rev-parse --verify refs/heads/side && + test_must_fail git rev-parse --verify refs/heads/side && git fetch origin && git remote prune origin && - ! git rev-parse --verify refs/heads/side2 && + test_must_fail git rev-parse --verify refs/heads/side2 && git rev-parse --verify refs/heads/side) ' @@ -212,10 +212,10 @@ test_expect_success 'add alt && prune' ' git branch -m side side2) && (cd alttst && git rev-parse --verify refs/remotes/origin/side && - ! git rev-parse --verify refs/remotes/origin/side2 && + test_must_fail git rev-parse --verify refs/remotes/origin/side2 && git fetch alt && git remote prune alt && - ! git rev-parse --verify refs/remotes/origin/side && + test_must_fail git rev-parse --verify refs/remotes/origin/side && git rev-parse --verify refs/remotes/origin/side2) ' @@ -320,7 +320,7 @@ test_expect_success '"remote show" does not show symbolic refs' ' test_expect_success 'reject adding remote with an invalid name' ' - ! git remote add some:url desired-name + test_must_fail git remote add some:url desired-name ' -- cgit v1.2.1