Skip to content

Commit 6b4f073

Browse files
committed
t7500: fix GIT_EDITOR shell snippet
2140b14 (commit: error out for missing commit message template, 2011-02-25) defined GIT_EDITOR="echo hello >\"\$1\"" for these two tests, with the intention that 'hello' would be written in the given file, but as Phillip Wood points out, GIT_EDITOR is invoked by shell after getting expanded to sh -c 'echo hello >"$1" "$@"' 'echo hello >"$1"' path/to/file which is not what we want. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 666b29b commit 6b4f073

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t7500-commit-template-squash-signoff.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test_expect_success 'nonexistent template file should return error' '
3131
echo changes >> foo &&
3232
git add foo &&
3333
(
34-
GIT_EDITOR="echo hello >\"\$1\"" &&
34+
GIT_EDITOR="echo hello >" &&
3535
export GIT_EDITOR &&
3636
test_must_fail git commit --template "$PWD"/notexist
3737
)
@@ -40,7 +40,7 @@ test_expect_success 'nonexistent template file should return error' '
4040
test_expect_success 'nonexistent template file in config should return error' '
4141
test_config commit.template "$PWD"/notexist &&
4242
(
43-
GIT_EDITOR="echo hello >\"\$1\"" &&
43+
GIT_EDITOR="echo hello >" &&
4444
export GIT_EDITOR &&
4545
test_must_fail git commit --allow-empty
4646
)

0 commit comments

Comments
 (0)