Re: [PATCH v3 1/2] update_symref: add REF_CREATE_ONLY option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 22, 2024, 16:56 UTC
- Message-ID
- <xmqq1q1b8w5n.fsf@gitster.g>
- In-Reply-To
- <D4CB89OCTXWW.2A4NL7RQP4IS@ferdinandy.com>
"Bence Ferdinandy" <bence@ferdinandy.com> writes:
Show 13 quoted lines
> On Sat Sep 21, 2024 at 15:40, Phillip Wood <phillip.wood123@gmail.com> wrote: >> On 19/09/2024 13:13, Bence Ferdinandy wrote: >> > Add a new REF_CREATE_ONLY flag for use by the files backend which will >> > only update the symref if it doesn't already exist. Add the possibility >> > to pass extra flags to refs_update_symref so that it can utilize this >> > new flag. >> >> I'm not sure we need a new flag to do this as it is already supported by >> the ref transaction api. > > Thanks, I was not aware of ref_transaction_create. It also seems to return with > TRANSACTION_NAME_CONFLICT so we should be able to see from the error code if > indeed the existence was the problem or something else went wrong.
Thank you for working on this, and thanks, Phillip, for a useful suggestion.