Re: [PATCH v3 21/23] try_remove_empty_parents(): don't accommodate consecutive slashes
- From
Jeff King <peff@peff.net>
- Date
- Jan 1, 2017, 05:59 UTC
- Message-ID
- <20170101055947.7b5jxih3wlprqcil@sigill.intra.peff.net>
- In-Reply-To
- <xmqqvatz4imu.fsf@gitster.mtv.corp.google.com>
On Sat, Dec 31, 2016 at 06:30:01PM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> Michael Haggerty <mhagger@alum.mit.edu> writes: > > > "refname" has already been checked by check_refname_format(), so it > > cannot have consecutive slashes. > > In the endgame state, this has two callers. Both use what came in > the transaction->updates[] array. Presumably "has already been > checked by check_refname_format()" says that whoever created entries > in that array must have called the function, but it would be helpful > to be more explicit here.
Hmm, yeah. This is called when we are deleting a ref, and I thought we explicitly _didn't_ do check_refname_format() when deleting, so that funny-named refs could be deleted. It's only is_refname_safe() that we must pass.
So I have no idea if that's a problem in the code or not, but it is at least not immediately obvious who is responsible for calling check_refname_format() here.
-Peff