Re: [PATCH 2/2] add--interactive: detect bogus diffFilter output
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 5, 2018, 22:09 UTC
- Message-ID
- <xmqqbmg2898w.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <878tb6nr6u.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 9 quoted lines
> On Sat, Mar 03 2018, Jeff King jotted:
>
>> + if (@colored && @colored != @diff) {
>
> nit: should just be:
>
> if (@colored != @diff) {
>
> It's not possible for @arrays in scalar context to be undefined.It is true that @array can not be undef, but your rewrite I think is wrong.
The first "do the comparison only @colored is true" is not about definedness. It is "@colored can be an empty array when the user is not using separate 'show these colored lines to the end user, feed these noncolored lines to git-apply command' feature, so @colored==0 and @diff > 0 is perfectly fine".