summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-07-12 13:07:51 -0700
committerJunio C Hamano <gitster@pobox.com>2018-07-12 13:31:57 -0700
commit650161a27782fe545dfe0efcb1ad971c1aebc8de (patch)
tree7aff1ebc62a9b591e1555f760a324bb7f10ca278
parenta42a58d7b62cc1d6301440e81a83feed9d7c118c (diff)
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 <gitster@pobox.com>
-rwxr-xr-xt/t3404-rebase-interactive.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 481a350090..489b6196e0 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -256,11 +256,18 @@ test_expect_success 'retain authorship' '
'
test_expect_success 'retain authorship w/ conflicts' '
+ oGIT_AUTHOR_NAME=$GIT_AUTHOR_NAME &&
+ test_when_finished "GIT_AUTHOR_NAME=\$oGIT_AUTHOR_NAME" &&
+
git reset --hard twerp &&
test_commit a conflict a conflict-a &&
git reset --hard twerp &&
- GIT_AUTHOR_NAME=AttributeMe \
+
+ GIT_AUTHOR_NAME=AttributeMe &&
+ export GIT_AUTHOR_NAME &&
test_commit b conflict b conflict-b &&
+ GIT_AUTHOR_NAME=$oGIT_AUTHOR_NAME &&
+
set_fake_editor &&
test_must_fail git rebase -i conflict-a &&
echo resolved >conflict &&