t7502-commit.sh: rearrange test to make more portable
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>
Brandon Casey committed
Jul 22, 2008 at 16:21 UTC
09b78bc1fc4e525bc68fa0ce76521457717fe675
1 file changed
+5
-3
t/t7502-commit.sh
+5
-3
@@ -228,10 +228,12 @@ EOF
228
229
test_expect_success 'a SIGTERM should break locks' '
230
echo >>negative &&
231
- "$SHELL_PATH" -c '\''
231
+ ! "$SHELL_PATH" -c '\''
232
echo kill -TERM $$ >> .git/FAKE_EDITOR
233
- GIT_EDITOR=.git/FAKE_EDITOR exec git commit -a'\'' && exit 1 # should fail
234
- ! test -f .git/index.lock
233
+ GIT_EDITOR=.git/FAKE_EDITOR
234
+ export GIT_EDITOR
235
+ exec git commit -a'\'' &&
236
+ test ! -f .git/index.lock
237
'
238
239
rm -f .git/MERGE_MSG .git/COMMIT_EDITMSG