From d74b541e0b40be0bf35e836bd8c6cbf653283d4b Mon Sep 17 00:00:00 2001 From: Martin Ågren Date: Sun, 19 Nov 2017 16:03:49 +0100 Subject: branch: respect `pager.branch` in list-mode only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar to de121ffe5 (tag: respect `pager.tag` in list-mode only, 2017-08-02), use the DELAY_PAGER_CONFIG-mechanism to only respect `pager.branch` when we are listing branches. We have two possibilities of generalizing what that earlier commit made to `git tag`. One is to interpret, e.g., --set-upstream-to as "it does not use an editor, so we should page". Another, the one taken by this commit, is to say "it does not list, so let's not page". That is in line with the approach of the series on `pager.tag` and in particular the wording in Documentation/git-tag.txt, which this commit reuses for git-branch.txt. This fixes the failing test added in the previous commit. Also adapt the test for whether `git branch --set-upstream-to` respects `pager.branch`. Signed-off-by: Martin Ågren Signed-off-by: Junio C Hamano --- t/t7006-pager.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 't/t7006-pager.sh') diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh index 12c72ef967..5998f7135b 100755 --- a/t/t7006-pager.sh +++ b/t/t7006-pager.sh @@ -232,7 +232,7 @@ test_expect_success TTY 'git branch respects --no-pager' ' ! test -e paginated.out ' -test_expect_failure TTY 'git branch --edit-description ignores pager.branch' ' +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" @@ -243,13 +243,13 @@ test_expect_failure TTY 'git branch --edit-description ignores pager.branch' ' test -e editor.used ' -test_expect_success TTY 'git branch --set-upstream-to respects pager.branch' ' +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 + ! test -e paginated.out ' # A colored commit log will begin with an appropriate ANSI escape -- cgit v1.2.3