Skip to content

Commit 650161a

Browse files
committed
t3404: fix use of "VAR=VAL cmd" with a shell function
Bash may take it happily but running test with dash reveals a breakage. This was not discovered for a long time as no tests after this test depended on GIT_AUTHOR_NAME to be reverted correctly back to the original value after this step is done. Signed-off-by: Junio C Hamano <[email protected]>
1 parent a42a58d commit 650161a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

t/t3404-rebase-interactive.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,18 @@ test_expect_success 'retain authorship' '
256256
'
257257

258258
test_expect_success 'retain authorship w/ conflicts' '
259+
oGIT_AUTHOR_NAME=$GIT_AUTHOR_NAME &&
260+
test_when_finished "GIT_AUTHOR_NAME=\$oGIT_AUTHOR_NAME" &&
261+
259262
git reset --hard twerp &&
260263
test_commit a conflict a conflict-a &&
261264
git reset --hard twerp &&
262-
GIT_AUTHOR_NAME=AttributeMe \
265+
266+
GIT_AUTHOR_NAME=AttributeMe &&
267+
export GIT_AUTHOR_NAME &&
263268
test_commit b conflict b conflict-b &&
269+
GIT_AUTHOR_NAME=$oGIT_AUTHOR_NAME &&
270+
264271
set_fake_editor &&
265272
test_must_fail git rebase -i conflict-a &&
266273
echo resolved >conflict &&

0 commit comments

Comments
 (0)