diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2018-07-02 02:23:41 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-03 21:38:04 +0200 |
commit | 83279748594cf1c7a38ebf518cd6b63cd3d8de37 (patch) | |
tree | 72db4e9015b7facf2e653c3ab016efaadb5f3592 /t/t5400-send-pack.sh | |
parent | Second batch for 2.19 cycle (diff) | |
download | git-83279748594cf1c7a38ebf518cd6b63cd3d8de37.tar.xz git-83279748594cf1c7a38ebf518cd6b63cd3d8de37.zip |
t: use test_might_fail() instead of manipulating exit code manually
These tests manually coerce the exit code of invoked commands to
"success" when they don't care if the command succeeds or fails since
failure of those commands should not cause the test to fail overall.
In doing so, they intentionally break the &&-chain. Modernize by
replacing manual exit code management with test_might_fail() and a
normal &&-chain.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5400-send-pack.sh')
-rwxr-xr-x | t/t5400-send-pack.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh index 911eae1bf7..f1932ea431 100755 --- a/t/t5400-send-pack.sh +++ b/t/t5400-send-pack.sh @@ -86,7 +86,7 @@ test_expect_success 'push can be used to delete a ref' ' test_expect_success 'refuse deleting push with denyDeletes' ' ( cd victim && - ( git branch -D extra || : ) && + test_might_fail git branch -D extra && git config receive.denyDeletes true && git branch extra master ) && @@ -119,7 +119,7 @@ test_expect_success 'override denyDeletes with git -c receive-pack' ' test_expect_success 'denyNonFastforwards trumps --force' ' ( cd victim && - ( git branch -D extra || : ) && + test_might_fail git branch -D extra && git config receive.denyNonFastforwards true ) && victim_orig=$(cd victim && git rev-parse --verify master) && |