Skip to content

Commit 77b5be2

Browse files
drafnelgitster
authored andcommitted
t/{t5541,lib-httpd}: replace problematic '!()' notation with test_must_fail
The '!()' notation is interpreted as a pattern-list on Ksh. The Ksh man page describe it as follows: !(pattern-list) Matches anything except one of the given patterns. Ksh performs a file glob using the pattern-list and then tries to execute the first file in the list. If a space is added between the '!' and the open parens, then Ksh will not interpret it as a pattern list, but in this case, it is preferred to use test_must_fail, so lets do so. Signed-off-by: Brandon Casey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 460d562 commit 77b5be2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

t/lib-httpd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ test_http_push_nonff() {
145145
echo "changed" > path2 &&
146146
git commit -a -m path2 --amend &&
147147
148-
!(git push -v origin >output 2>&1) &&
148+
test_must_fail git push -v origin >output 2>&1 &&
149149
(cd "$REMOTE_REPO" &&
150150
test $HEAD = $(git rev-parse --verify HEAD))
151151
'

t/t5541-http-push.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
128128
129129
# push master too; this ensures there is at least one '"'push'"' command to
130130
# the remote helper and triggers interaction with the helper.
131-
!(git push -v origin +master master:retsam >output 2>&1) &&
131+
test_must_fail git push -v origin +master master:retsam >output 2>&1 &&
132132
133133
grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *master -> master (forced update)$" output &&
134134
grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output &&

0 commit comments

Comments
 (0)