Re: [PATCH 2/7] stash: integrate with sparse index
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 26, 2022, 16:21 UTC
- Message-ID
- <xmqqy1zrrf2q.fsf@gitster.g>
- In-Reply-To
- <f332fec9-da00-0063-4c88-765fa3639ea1@github.com>
Derrick Stolee <derrickstolee@github.com> writes:
Show 16 quoted lines
> On 4/25/2022 1:49 PM, Victoria Dye via GitGitGadget wrote:
>> From: Victoria Dye <vdye@github.com>
>>
>> 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.