Code

grep: run setup_git_directory_gently() sooner
[git.git] / t / t7006-pager.sh
index 71d3ceff8f06ad33aee5e48f85e97164df447a59..bb9533581ebaf57eb2f4904dcd41d13b85e78270 100755 (executable)
@@ -106,6 +106,19 @@ test_expect_success TTY 'no pager with --no-pager' '
        ! test -e paginated.out
 '
 
+test_expect_success TTY 'configuration can disable pager' '
+       rm -f paginated.out &&
+       test_might_fail git config --unset pager.grep &&
+       test_terminal git grep initial &&
+       test -e paginated.out &&
+
+       rm -f paginated.out &&
+       git config pager.grep false &&
+       test_when_finished "git config --unset pager.grep" &&
+       test_terminal git grep initial &&
+       ! test -e paginated.out
+'
+
 # A colored commit log will begin with an appropriate ANSI escape
 # for the first color; the text "commit" comes later.
 colorful() {
@@ -369,4 +382,13 @@ test_GIT_PAGER_overrides  expect_success test_must_fail 'git -p'
 
 test_doesnt_paginate      expect_failure test_must_fail 'git -p nonsense'
 
+test_pager_choices                       'git shortlog'
+test_expect_success 'setup: configure shortlog not to paginate' '
+       git config pager.shortlog false
+'
+test_doesnt_paginate      expect_success 'git shortlog'
+test_no_local_config_subdir expect_success 'git shortlog'
+test_default_pager        expect_success 'git -p shortlog'
+test_core_pager_subdir    expect_success 'git -p shortlog'
+
 test_done