Skip to content
  • Martin Ågren's avatar
    t7006: add tests for how git tag paginates · b3ee740c
    Martin Ågren authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    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: default avatarMartin Ågren <martin.agren@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    b3ee740c