Subject: Re: [PATCH] files-backend: cheapen refname_available check when locking refs

From: Junio C Hamano <[email-masked]>
Date: Thu, 17 Aug 2017 14:37:51 -0700

Jeff King <[email-masked]> writes:

>> diff --git a/refs/files-backend.c b/refs/files-backend.c
>> index e9b95592b6..f2a420c611 100644
>> --- a/refs/files-backend.c
>> +++ b/refs/files-backend.c
>> @@ -631,11 +631,11 @@ static int lock_raw_ref(struct files_ref_store *refs,
>>  
>>  		/*
>>  		 * If the ref did not exist and we are creating it,
>> -		 * make sure there is no existing ref that conflicts
>> -		 * with refname:
>> +		 * make sure there is no existing packed ref that
>> +		 * conflicts with refname:
>>  		 */
>>  		if (refs_verify_refname_available(
>> -				    &refs->base, refname,
>> +				    refs->packed_ref_store, refname,
>>  				    extras, skip, err))
>>  			goto error_return;
>>  	}
>
> This seems too easy to be true. :) But I think it matches what we were
> doing before 524a9fdb51 (so it's correct), and the performance numbers
> don't lie.

Thanks, all.  The log message explained the change very well, even
though I agree that the patch text does indeed look too easy to be
true ;-).

Will queue.