git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] refs: return conflict error when checking packed refs

From
Junio C Hamano <gitster@pobox.com>
Date
May 6, 2024, 19:01 UTC
Message-ID
<xmqqttjaydbw.fsf@gitster.g>
In-Reply-To
<CAOLa=ZSre3f+0SR-_migfkPONqhinobKjU=NnGOJ_sTNM_L5ug@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 20 quoted lines
>> diff --git a/refs/files-backend.c b/refs/files-backend.c
>> index a098d14ea00..97473f377d1 100644
>> --- a/refs/files-backend.c
>> +++ b/refs/files-backend.c
>> @@ -794,8 +794,10 @@ static int lock_raw_ref(struct files_ref_store *refs,
>>  		 */
>>  		if (refs_verify_refname_available(
>>  				    refs->packed_ref_store, refname,
>> -				    extras, NULL, err))
>> +				    extras, NULL, err)) {
>> +			ret = TRANSACTION_NAME_CONFLICT;
>>  			goto error_return;
>> +		}
>>  	}
>>
>>  	ret = 0;
>>
>
> Shouldn't we also do this change in `lock_ref_oid_basic` where we gather
> the same lock again for creating the reflog entry?
An interesting question.
Previous: Karthik NayakNext: Ivan Tse
Message 8 of 11 in “refs: return conflict error when checking packed refs”
  1. refs: return conflict error when checking packed refsIvan Tse via GitGitGadget, Apr 30, 2024
  2. Patrick SteinhardtMay 2, 2024
  3. refs: return conflict error when checking packed refsIvan Tse via GitGitGadget, May 3, 2024
  4. Patrick SteinhardtMay 3, 2024
  5. refs: return conflict error when checking packed refsIvan Tse via GitGitGadget, May 4, 2024
  6. Patrick SteinhardtMay 6, 2024
  7. Karthik NayakMay 6, 2024
  8. Junio C HamanoMay 6, 2024
  9. Ivan TseMay 7, 2024
  10. Karthik NayakMay 7, 2024
  11. Ivan TseMay 8, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.