]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/{t5541,lib-httpd}: replace problematic '!()' notation with test_must_fail
authorBrandon Casey <drafnel@gmail.com>
Tue, 20 Jul 2010 18:27:55 +0000 (13:27 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Jul 2010 18:37:45 +0000 (11:37 -0700)
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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-httpd.sh
t/t5541-http-push.sh

index 71effc5becd09d1289361767f6f54af8f1594627..e733f6516fdf98e48d5c7cd36ecc89d36166eea1 100644 (file)
@@ -145,7 +145,7 @@ test_http_push_nonff() {
                echo "changed" > path2 &&
                git commit -a -m path2 --amend &&
 
-               !(git push -v origin >output 2>&1) &&
+               test_must_fail git push -v origin >output 2>&1 &&
                (cd "$REMOTE_REPO" &&
                 test $HEAD = $(git rev-parse --verify HEAD))
        '
index 504884b9f8fab3bfa34e3dc97d3dc7aad297e626..b0c2a2c3aea811ec023423bdb486de5412fa79c5 100755 (executable)
@@ -128,7 +128,7 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
 
        # push master too; this ensures there is at least one '"'push'"' command to
        # the remote helper and triggers interaction with the helper.
-       !(git push -v origin +master master:retsam >output 2>&1) &&
+       test_must_fail git push -v origin +master master:retsam >output 2>&1 &&
 
        grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *master -> master (forced update)$" output &&
        grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output &&