summaryrefslogtreecommitdiff
path: root/t/t6046-merge-skip-unneeded-updates.sh
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2018-07-13 05:52:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-16 21:55:01 (GMT)
commit079b087c8eaf8119c4b159598e7b6965c1ca3fe9 (patch)
treeb8ee700325bd72dac778dc2ba2f843744def22bf /t/t6046-merge-skip-unneeded-updates.sh
parentf44a7442f6abeea0059fae46ce482b0c49c27de1 (diff)
downloadgit-079b087c8eaf8119c4b159598e7b6965c1ca3fe9.zip
git-079b087c8eaf8119c4b159598e7b6965c1ca3fe9.tar.gz
git-079b087c8eaf8119c4b159598e7b6965c1ca3fe9.tar.bz2
t6046/t9833: fix use of "VAR=VAL cmd" with a shell function
Unlike "FOO=bar cmd" one-shot environment variable assignments which exist only for the invocation of 'cmd', those assigned by "FOO=bar shell_func" exist within the running shell and continue to do so until the process exits (or are explicitly unset). It is unlikely that this behavior was intended by the test author. In these particular tests, the "FOO=bar shell_func" invocations are already in subshells, so the assignments don't last too long, don't appear to harm subsequent commands in the same subshells, and don't affect other tests in the same scripts, however, the usage is nevertheless misleading and poor practice, so fix the tests to assign and export the environment variables in the usual fashion. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6046-merge-skip-unneeded-updates.sh')
-rwxr-xr-xt/t6046-merge-skip-unneeded-updates.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/t6046-merge-skip-unneeded-updates.sh b/t/t6046-merge-skip-unneeded-updates.sh
index fcefffc..38e24f7 100755
--- a/t/t6046-merge-skip-unneeded-updates.sh
+++ b/t/t6046-merge-skip-unneeded-updates.sh
@@ -366,7 +366,9 @@ test_expect_success '2c-check: Modify b & add c VS rename b->c' '
git checkout A^0 &&
- GIT_MERGE_VERBOSITY=3 test_must_fail git merge -s recursive B^0 >out 2>err &&
+ GIT_MERGE_VERBOSITY=3 &&
+ export GIT_MERGE_VERBOSITY &&
+ test_must_fail git merge -s recursive B^0 >out 2>err &&
test_i18ngrep "CONFLICT (rename/add): Rename b->c" out &&
test_i18ngrep ! "Skipped c" out &&