Re: [PATCH v3 1/1] t1403: verify that path exists and is a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Mahendra Dani <danimahendra0904@xxxxxxxxx> writes:
>
>> test -e does not provide a nice error message when
>> we hit test failures, so use test_path_exists() instead
>> and verify that if the path exists then it is a file using test_path_is_file().
>>
>> Signed-off-by: Mahendra Dani <danimahendra0904@xxxxxxxxx>
>> ---
>>  t/t1403-show-ref.sh | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/t/t1403-show-ref.sh b/t/t1403-show-ref.sh
>> index 9d698b3cc3..4afde01a29 100755
>> --- a/t/t1403-show-ref.sh
>> +++ b/t/t1403-show-ref.sh
>> @@ -196,7 +196,8 @@ test_expect_success 'show-ref --verify with dangling ref' '
>>  
>>  	remove_object() {
>>  		file=$(sha1_file "$*") &&
>> -		test -e "$file" &&
>> +		test_path_exists "$file" &&
>> +		test_path_is_file "$file" &&
>>  		rm -f "$file"
>>  	} &&
>
> Makes sense.  Will queue.

No, no, no.  test_is_file alone is sufficient---if the thing does
not exist, it would not be a file anyway ;-)





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux