Skip to content

Commit 09b78bc

Browse files
drafnelgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 03b9dfb commit 09b78bc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

t/t7502-commit.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,12 @@ EOF
228228

229229
test_expect_success 'a SIGTERM should break locks' '
230230
echo >>negative &&
231-
"$SHELL_PATH" -c '\''
231+
! "$SHELL_PATH" -c '\''
232232
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
235237
'
236238

237239
rm -f .git/MERGE_MSG .git/COMMIT_EDITMSG

0 commit comments

Comments
 (0)