diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2021-12-09 05:11:10 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-13 18:29:48 (GMT) |
commit | 03949e33f58223dd2d8465f4dd8042e5e581fcef (patch) | |
tree | b5d3ed0b3bc19d18309a7563e6045442bd2346fc /t/t9400-git-cvsserver-server.sh | |
parent | 77b1d9f355b44b68b4bb08a8143d13330fe4c562 (diff) | |
download | git-03949e33f58223dd2d8465f4dd8042e5e581fcef.zip git-03949e33f58223dd2d8465f4dd8042e5e581fcef.tar.gz git-03949e33f58223dd2d8465f4dd8042e5e581fcef.tar.bz2 |
tests: apply modern idiom for exiting loop upon failure
Rather than maintaining a flag indicating a failure within a loop and
aborting the test when the loop ends if the flag is set, modern practice
is to signal the failure immediately by exiting the loop early via
`return 1` (or `exit 1` if inside a subshell). Simplify these loops by
following the modern idiom.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9400-git-cvsserver-server.sh')
-rwxr-xr-x | t/t9400-git-cvsserver-server.sh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh index 17f988e..ca50574 100755 --- a/t/t9400-git-cvsserver-server.sh +++ b/t/t9400-git-cvsserver-server.sh @@ -350,10 +350,9 @@ test_expect_success 'cvs update (subdirectories)' \ test_cmp "$dir/$filename" "../$dir/$filename"; then : else - echo >failure + exit 1 fi - done) && - test ! -f failure' + done)' cd "$WORKDIR" test_expect_success 'cvs update (delete file)' \ |