Subject: Re: [PATCH] pathspec: die on empty strings as pathspec

From: Junio C Hamano <[email-masked]>
Date: Fri, 23 Jun 2017 13:59:38 -0700

Torsten Bögershausen <[email-masked]> writes:

> On 23/06/17 20:04, Junio C Hamano wrote:
>...
>> At this point in the test sequence, there is no modified path that
>> need to be further added before committing; the working tree is
>> empty except for .gitattributes which was just added to the index.
>> So we could instead pass no pathspec, but this is a conversion more
>> faithful to the original.
>>
>> Signed-off-by: Junio C Hamano <[email-masked]>
>> ---
>>   t/t0027-auto-crlf.sh | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
>> index 93725895a4..e41c9b3bb2 100755
>> --- a/t/t0027-auto-crlf.sh
>> +++ b/t/t0027-auto-crlf.sh
>> @@ -322,7 +322,7 @@ test_expect_success 'setup master' '
>>   	echo >.gitattributes &&
>>   	git checkout -b master &&
>>   	git add .gitattributes &&
>> -	git commit -m "add .gitattributes" "" &&
>> +	git commit -m "add .gitattributes" . &&
>
> Reading the context here, there shouldn't be a "pathspec" at all,
> as .gitattributes had been added just one line above.
>
> The line should have been from the very beginning:
> 	git commit -m "add .gitattributes"  &&
>
> # What do you think ?

See above ;-)

And to be more explicit, it is not a fault of your earlier change,
either, that we didn't notice this problem since we started "warning".

We need to see if we can update our test framework to help us
better; I really think the test framework could and should have
helped us to notice this soon after we went into "keep behaving as
before but warn" stage.