X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4014-format-patch.sh;h=a46d88828ba2244023a6b1980914fd539c807782;hb=fea6128baec24fcfe9433a34a06bd9d6e6298bab;hp=07bf6eb49dd2879758f64a8c09a0ae8d7e54dd45;hpb=9f5074e0348071532911cffb622d7df6754a9743;p=git.git diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 07bf6eb49..a46d88828 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -6,6 +6,7 @@ test_description='various format-patch tests' . ./test-lib.sh +. "$TEST_DIRECTORY"/lib-terminal.sh test_expect_success setup ' @@ -613,7 +614,7 @@ echo "fatal: --name-only does not make sense" > expect.name-only echo "fatal: --name-status does not make sense" > expect.name-status echo "fatal: --check does not make sense" > expect.check -test_expect_success 'options no longer allowed for format-patch' ' +test_expect_success C_LOCALE_OUTPUT 'options no longer allowed for format-patch' ' test_must_fail git format-patch --name-only 2> output && test_cmp expect.name-only output && test_must_fail git format-patch --name-status 2> output && @@ -686,4 +687,26 @@ test_expect_success 'format-patch --signature="" supresses signatures' ' ! grep "^-- \$" output ' +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_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_path_is_missing pager_used && + test_path_is_missing .git/pager_used +' + test_done