Re: [PATCH v8 39/44] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-05-22 Thread Ronnie Sahlberg
On Thu, May 22, 2014 at 10:44 AM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: >> On Wed, May 21, 2014 at 6:42 PM, Jonathan Nieder wrote: > >>> $ git rev-parse HEAD >.git/refs/heads/foo..bar >>> $ git branch -m foo..bar something-saner >>> fatal: Invalid branch name: 'f

Re: [PATCH v8 39/44] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-05-22 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > On Wed, May 21, 2014 at 6:42 PM, Jonathan Nieder wrote: >> $ git rev-parse HEAD >.git/refs/heads/foo..bar >> $ git branch -m foo..bar something-saner >> fatal: Invalid branch name: 'foo..bar' >> >> "git branch -m" has an explicit codepath ("recover

Re: [PATCH v8 39/44] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-05-22 Thread Ronnie Sahlberg
On Wed, May 21, 2014 at 6:42 PM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: >> --- a/refs.c >> +++ b/refs.c >> @@ -2044,6 +2044,9 @@ static struct ref_lock *lock_ref_sha1_basic(const char >> *refname, >> int missing = 0; >> int attempts_remaining = 3; >> >> + if (check_refnam

Re: [PATCH v8 39/44] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-05-21 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > --- a/refs.c > +++ b/refs.c > @@ -2044,6 +2044,9 @@ static struct ref_lock *lock_ref_sha1_basic(const char > *refname, > int missing = 0; > int attempts_remaining = 3; > > + if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) > + return

[PATCH v8 39/44] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-05-15 Thread Ronnie Sahlberg
Move the check for check_refname_format from lock_any_ref_for_update to lock_ref_sha1_basic. At some later stage we will get rid of lock_any_ref_for_update completely. This leaves lock_any_ref_for_updates as a no-op wrapper which could be removed. But this wrapper is also called from an external c