Subject: Re: [PATCH 2/7] stash: integrate with sparse index

From: Junio C Hamano <[email-masked]>
Date: Tue, 26 Apr 2022 09:21:01 -0700

Derrick Stolee <[email-masked]> writes:

> On 4/25/2022 1:49 PM, Victoria Dye via GitGitGadget wrote:
>> From: Victoria Dye <[email-masked]>
>> 
>> Enable sparse index in 'git stash' by disabling
>> 'command_requires_full_index'.
>
>>  ensure_not_expanded () {
>>  	rm -f trace2.txt &&
>> -	echo >>sparse-index/untracked.txt &&
>> +	if test -z $WITHOUT_UNTRACKED_TXT
>
> Do we need quotes around "$WITHOUT_UNTRACKED_TXT"?
>
> I mean, I suppose we don't since the tests pass when this variable
> is unset, but I think it is a good practice to be careful about
> empty variables. Or am I wrong?

Interesting.  I do not think the reason why

	test -z && echo true

says "true" is "-z" noticed an empty string---it is "test $string"
that says "true" when "$string" is not a recognised command and is
not an empty string, no?

You are absolutely right that the above must be quoted.

Thanks for carefully reading.