Re: [PATCH 2/3] branch: split validate_new_branchname() into two

2017-10-21 Thread Junio C Hamano
Kaartic Sivaraam writes: >> +/* >> + * Check if a branch 'name' can be created as a new branch; die otherwise. >> + * 'force' can be used when it is OK for the named branch already exists. >> + * Return 1 if the named branch already exists; return 0 otherwise. >> + *

Re: [PATCH 2/3] branch: split validate_new_branchname() into two

2017-10-20 Thread Kaartic Sivaraam
On Fri, 2017-10-13 at 14:11 +0900, Junio C Hamano wrote: > > diff --git a/branch.c b/branch.c > index 7404597678..2c3a364a0b 100644 > --- a/branch.c > +++ b/branch.c > @@ -178,19 +178,31 @@ int read_branch_desc(struct strbuf *buf, const char > *branch_name) > return 0; > } > > -int

[PATCH 2/3] branch: split validate_new_branchname() into two

2017-10-12 Thread Junio C Hamano
Checking if a proposed name is appropriate for a branch is strictly a subset of checking if we want to allow creating or updating a branch with such a name. The mysterious sounding 'attr_only' parameter to validate_new_branchname() is used to switch the function between these two roles. Instead,