Re: [PATCH 1/5] refs: make branchname helpers repository aware
- From
Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com>
- Date
- Mar 28, 2026, 12:45 UTC
- Message-ID
- <CAPYXD65H87wfffuvGWZtnvn19-2kwQFc1bzLHpyw-3X8QC9qvQ@mail.gmail.com>
- In-Reply-To
- <acY2pZnCSEf5hcWZ@pks.im>
On Fri, Mar 27, 2026 at 1:20 PM Patrick Steinhardt <ps@pks.im> wrote:
Show 28 quoted lines
> > On Wed, Mar 25, 2026 at 10:14:18PM +0530, Shreyansh Paliwal wrote: > > diff --git a/branch.h b/branch.h > > index 3dc6e2a0ff..3aa53eb243 100644 > > --- a/branch.h > > +++ b/branch.h > > @@ -111,7 +111,7 @@ const char *branch_checked_out(const char *refname); > > * Return 1 if the named branch already exists; return 0 otherwise. > > * Fill ref with the full refname for the branch. > > */ > > -int validate_branchname(const char *name, struct strbuf *ref); > > +int validate_branchname(const char *name, struct strbuf *ref, struct repository *repo); > > > > /* > > * Check if a branch 'name' can be created as a new branch; die otherwise. > > @@ -119,7 +119,8 @@ int validate_branchname(const char *name, struct strbuf *ref); > > * Return 1 if the named branch already exists; return 0 otherwise. > > * Fill ref with the full refname for the branch. > > */ > > -int validate_new_branchname(const char *name, struct strbuf *ref, int force); > > +int validate_new_branchname(const char *name, struct strbuf *ref, int force, > > + struct repository *repo); > > > > /* > > * Remove information about the merge state on the current > > It's more customary in our code base to have the repository be the first > parameter. Other than that this patch looks good to me.
Got it. I will send a reroll for that. Thanks for reviewing.