t7006: add tests for how git tag paginates
commitb3ee740c8275675a97974bcb27a18eb7997fa907
authorMartin Ågren <martin.agren@gmail.com>
Wed, 2 Aug 2017 19:40:52 +0000 (2 21:40 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 Aug 2017 18:08:10 +0000 (3 11:08 -0700)
tree6be8ced224a125550a5f09a98ab65d5457f7d9e7
parent033fe3d92ca16c36fb45ed7cb58d42344088e7bd
t7006: add tests for how git tag paginates

Using, e.g., `git -c pager.tag tag -a new-tag` results in errors such as
"Vim: Warning: Output is not to a terminal" and a garbled terminal.
Someone who makes use of both `git tag -a` and `git tag -l` will
probably not set `pager.tag`, so that `git tag -a` will actually work,
at the cost of not paging output of `git tag -l`.

Since we're about to change how `git tag` respects `pager.tag`, add tests
around this, including how the configuration is ignored if --no-pager or
--paginate are used.

Construct tests with a few different subcommands. First, use -l. Second,
use "no arguments" and --contains, since those imply -l. (There are
more arguments which imply -l, but using these two should be enough.)

Third, use -a as a representative for "not -l". Actually, the tests use
`git tag -am` so no editor is launched, but that is irrelevant, since we
just want to see whether the pager is used or not. Make one of the tests
demonstrate the broken behavior mentioned above, where `git tag -a`
respects `pager.tag`.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7006-pager.sh