Re: [PATCH 1/5] refs: make branchname helpers repository aware
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Mar 27, 2026, 07:49 UTC
- Message-ID
- <acY2pZnCSEf5hcWZ@pks.im>
- In-Reply-To
- <20260325164833.1216577-2-shreyanshpaliwalcmsmn@gmail.com>
On Wed, Mar 25, 2026 at 10:14:18PM +0530, Shreyansh Paliwal wrote:
Show 23 quoted lines
> 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.
Patrick