]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t4014-format-patch.sh
tests: use "env" to run commands with temporary env-var settings
[thirdparty/git.git] / t / t4014-format-patch.sh
index 73194b2c3dbe267b759bfd036367366b4955f0c4..9c8063314688ec0c03d3fb2099379cbbf4ff2e19 100755 (executable)
@@ -764,22 +764,14 @@ test_expect_success 'format-patch --signature="" suppresses signatures' '
 
 test_expect_success TTY 'format-patch --stdout paginates' '
        rm -f pager_used &&
-       (
-               GIT_PAGER="wc >pager_used" &&
-               export GIT_PAGER &&
-               test_terminal git format-patch --stdout --all
-       ) &&
+       test_terminal env GIT_PAGER="wc >pager_used" git format-patch --stdout --all &&
        test_path_is_file pager_used
 '
 
  test_expect_success TTY 'format-patch --stdout pagination can be disabled' '
        rm -f pager_used &&
-       (
-               GIT_PAGER="wc >pager_used" &&
-               export GIT_PAGER &&
-               test_terminal git --no-pager format-patch --stdout --all &&
-               test_terminal git -c "pager.format-patch=false" format-patch --stdout --all
-       ) &&
+       test_terminal env GIT_PAGER="wc >pager_used" git --no-pager format-patch --stdout --all &&
+       test_terminal env GIT_PAGER="wc >pager_used" git -c "pager.format-patch=false" format-patch --stdout --all &&
        test_path_is_missing pager_used &&
        test_path_is_missing .git/pager_used
 '