diff options
author | Richard Hansen <rhansen@bbn.com> | 2015-06-17 17:11:21 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-17 15:16:52 -0700 |
commit | d5c1b7c286b2ad2206afe2f86ae228744bd283fb (patch) | |
tree | d840470a756e517a3ae11ab0cc104c2d4e7ae60c /t/t7405-submodule-merge.sh | |
parent | Revert "test-lib.sh: do tests for color support after changing HOME" (diff) | |
download | tgif-d5c1b7c286b2ad2206afe2f86ae228744bd283fb.tar.xz |
test-lib.sh: fix color support when tput needs ~/.terminfo
If tput needs ~/.terminfo for the current $TERM, then tput will
succeed before HOME is changed to $TRASH_DIRECTORY (causing color to
be set to 't') but fail afterward.
One possible way to fix this is to treat HOME like TERM: back up the
original value and temporarily restore it before say_color() runs
tput.
Instead, pre-compute and save the color control sequences before
changing either TERM or HOME. Use the saved control sequences in
say_color() rather than call tput each time. This avoids the need to
back up and restore the TERM and HOME variables, and it avoids the
overhead of a subshell and two invocations of tput per call to
say_color().
Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7405-submodule-merge.sh')
0 files changed, 0 insertions, 0 deletions