OSDN Git Service

t7502-commit.sh: rearrange test to make more portable
authorBrandon Casey <casey@nrlssc.navy.mil>
Tue, 22 Jul 2008 21:21:10 +0000 (16:21 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Jul 2008 18:36:31 +0000 (11:36 -0700)
Some shells have problems with one-shot environment variable export
and function calls. The sequence is rearranged to avoid the one-shot
and to allow the test script to be linked together with '&&'.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7502-commit.sh

index c25eff9..4f2682e 100755 (executable)
@@ -228,10 +228,12 @@ EOF
 
 test_expect_success 'a SIGTERM should break locks' '
        echo >>negative &&
-       "$SHELL_PATH" -c '\''
+       "$SHELL_PATH" -c '\''
          echo kill -TERM $$ >> .git/FAKE_EDITOR
-         GIT_EDITOR=.git/FAKE_EDITOR exec git commit -a'\'' && exit 1  # should fail
-       ! test -f .git/index.lock
+         GIT_EDITOR=.git/FAKE_EDITOR
+         export GIT_EDITOR
+         exec git commit -a'\'' &&
+       test ! -f .git/index.lock
 '
 
 rm -f .git/MERGE_MSG .git/COMMIT_EDITMSG