On 2015-01-06T11:06-08:00, Junio C Hamano wrote:
>> +unset color
>> while test "$#" -ne 0
>> do
>> case "$1" in
>> @@ -258,40 +250,6 @@ then
>> verbose=t
>> fi
>>
>> -if test -n "$color"
>> ...
>> @@ -857,6 +815,52 @@ HOME="$TRASH_DIRECTORY"
>> GNUPGHOME="$HOME/gnupg-home-not-used"
>> export HOME GNUPGHOME
>>
>> +# run the tput tests *after* changing HOME (in case ncurses needs
>> +# ~/.terminfo for $TERM)
>> +test -n "${color+set}" || [ "x$ORIGINAL_TERM" != "xdumb" ] && (
>
> OK, $color used to be boolean between '' (unset included) and 't',
> but now we do this after possibly processing the --no-color
> argument, so this is guarded slightly differently from the original.
>
> Makes sense.
I updated the commit message to make this change more obvious.
> This is a tangent but this patch shows 2 places out of the only
> three places we use [ ... ] construct (as opposed to a more
> traditionalist "test"). Perhaps we may want to fix them with a
> follow-up patch?
I added a prequel patch to address this.
Thank you for taking a look,
Richard
Richard Hansen (2):
use 'test ...' instead of '[ ... ]'
test-lib.sh: do tests for color support after changing HOME
t/test-lib.sh | 92 +++++++++++++++++++++++++++++++----------------------------
1 file changed, 48 insertions(+), 44 deletions(-)
--
2.2.1
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html