diff options
author | Richard Hansen <rhansen@bbn.com> | 2015-01-06 17:57:51 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-01-07 10:38:01 -0800 |
commit | 102fc80d32094ad6598b17ab9d607516ee8edc4a (patch) | |
tree | 7740cee5fc1b3946cbf292f6726b422e2b1a4cb0 /builtin/archive.c | |
parent | test-lib: use 'test ...' instead of '[ ... ]' (diff) | |
download | tgif-102fc80d32094ad6598b17ab9d607516ee8edc4a.tar.xz |
test-lib.sh: do tests for color support after changing HOME
If ncurses needs ~/.terminfo for the current $TERM, then tput will
succeed before changing HOME to $TRASH_DIRECTORY but fail afterward.
Move the tests that determine whether there is color support after
changing HOME so that color=t is set if and only if tput would succeed
when say_color() is run.
Note that color=t is now set after --no-color is processed, so the
condition to set color=t has changed: it is now set only if
color has not already been set to the empty string by --no-color.
This disables color support for those that need ~/.terminfo for
their TERM, but it's better than filling the screen with:
tput: unknown terminal "custom-terminal-name-here"
An alternative would be to symlink or copy the user's terminfo
database into $TRASH_DIRECTORY, but this is tricky due to the lack of
a standard name for the terminfo database (for example, instead of a
~/.terminfo directory, NetBSD uses a ~/.terminfo.cdb database file).
Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/archive.c')
0 files changed, 0 insertions, 0 deletions