summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorMartin Ågren <martin.agren@gmail.com>2017-11-19 15:03:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-20 00:50:25 (GMT)
commitd74b541e0b40be0bf35e836bd8c6cbf653283d4b (patch)
treed14933fb659159e4aea5712a4ee2c38fe1fe674b /builtin
parented104fa9e1016f8ac5f85642ed11e16b09510bea (diff)
downloadgit-d74b541e0b40be0bf35e836bd8c6cbf653283d4b.zip
git-d74b541e0b40be0bf35e836bd8c6cbf653283d4b.tar.gz
git-d74b541e0b40be0bf35e836bd8c6cbf653283d4b.tar.bz2
branch: respect `pager.branch` in list-mode only
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 <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/branch.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 8a0595e..3eb31cd 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -648,6 +648,9 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
rename *= 2;
}
+ if (list)
+ setup_auto_pager("branch", 0);
+
if (delete) {
if (!argc)
die(_("branch name required"));