Merge branch 'tc/format-patch-p'

* tc/format-patch-p:
  format-patch: page output with --stdout
This commit is contained in:
Junio C Hamano 2010-12-12 21:49:52 -08:00
commit 33935dca6d
2 changed files with 25 additions and 0 deletions

View file

@ -1158,6 +1158,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
if (!use_stdout)
output_directory = set_outdir(prefix, output_directory);
else
setup_pager();
if (output_directory) {
if (use_stdout)

View file

@ -6,6 +6,7 @@
test_description='various format-patch tests'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
test_expect_success setup '
@ -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