Re: [PATCH v2 06/10] refs: skip collision checks in initial transactions
On Wed, Nov 20, 2024 at 11:21:44AM +0100, Christian Couder wrote:
Show 19 quoted lines
> On Wed, Nov 20, 2024 at 8:54 AM Patrick Steinhardt <ps@pks.im> wrote:
>
> > diff --git a/refs.c b/refs.c
> > index 0f10c565bbb4e0d91210c52a3221a224e4264d28..d690eb19b3fd7083a5309deb98738547e4f48040 100644
> > --- a/refs.c
> > +++ b/refs.c
> > @@ -2324,6 +2324,7 @@ int refs_verify_refname_available(struct ref_store *refs,
> > const char *refname,
> > const struct string_list *extras,
> > const struct string_list *skip,
> > + int initial_transaction,
>
> Nit: Using 'unsigned int' instead of 'int' might be slightly better as
> the type would be the same as "transaction->flags &
> REF_TRANSACTION_FLAG_INITIAL" we pass as an argument below. It might
> also make it slightly simpler to convert "int initial_transaction" to
> "int flags" if we add more flags and need to do that in the future.
> (Other functions add an 'int initial_transaction' argument which could
> be an 'unsigned int' instead.)
Makes sense, will adapt.
Patrick