summaryrefslogtreecommitdiff
path: root/t/t7006-pager.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-11-28 04:41:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-28 04:41:50 (GMT)
commit3b49e1b0e900a88cab9e1b035dac83c0dd6ae2b3 (patch)
tree31a86627d257322a94ef0e3977fb5b89b18477c6 /t/t7006-pager.sh
parent16169285f1e63f6a3d9ec10e48f55d6825d3156b (diff)
parent0ae19de74f6f5d6c6f9c80899e1ecd611c5b9827 (diff)
downloadgit-3b49e1b0e900a88cab9e1b035dac83c0dd6ae2b3.zip
git-3b49e1b0e900a88cab9e1b035dac83c0dd6ae2b3.tar.gz
git-3b49e1b0e900a88cab9e1b035dac83c0dd6ae2b3.tar.bz2
Merge branch 'ma/branch-list-paginate'
"git branch --list" learned to show its output through the pager by default when the output is going to a terminal, which is controlled by the pager.branch configuration variable. This is similar to a recent change to "git tag --list". * ma/branch-list-paginate: branch: change default of `pager.branch` to "on" branch: respect `pager.branch` in list-mode only t7006: add tests for how git branch paginates
Diffstat (limited to 't/t7006-pager.sh')
-rwxr-xr-xt/t7006-pager.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 865168e..f5f46a9 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -214,6 +214,44 @@ test_expect_success TTY 'git tag as alias respects pager.tag with -l' '
! test -e paginated.out
'
+test_expect_success TTY 'git branch defaults to paging' '
+ rm -f paginated.out &&
+ test_terminal git branch &&
+ test -e paginated.out
+'
+
+test_expect_success TTY 'git branch respects pager.branch' '
+ rm -f paginated.out &&
+ test_terminal git -c pager.branch=false branch &&
+ ! test -e paginated.out
+'
+
+test_expect_success TTY 'git branch respects --no-pager' '
+ rm -f paginated.out &&
+ test_terminal git --no-pager branch &&
+ ! test -e paginated.out
+'
+
+test_expect_success TTY 'git branch --edit-description ignores pager.branch' '
+ rm -f paginated.out editor.used &&
+ write_script editor <<-\EOF &&
+ echo "New description" >"$1"
+ touch editor.used
+ EOF
+ EDITOR=./editor test_terminal git -c pager.branch branch --edit-description &&
+ ! test -e paginated.out &&
+ test -e editor.used
+'
+
+test_expect_success TTY 'git branch --set-upstream-to ignores pager.branch' '
+ rm -f paginated.out &&
+ git branch other &&
+ test_when_finished "git branch -D other" &&
+ test_terminal git -c pager.branch branch --set-upstream-to=other &&
+ test_when_finished "git branch --unset-upstream" &&
+ ! 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() {