Re: [PATCH 05/23] refs_ref_iterator_begin(): don't check prefixes redundantly
- From
Jeff King <peff@peff.net>
- Date
- May 17, 2017, 12:59 UTC
- Message-ID
- <20170517125947.npk4x65e2wqwqvkh@sigill.intra.peff.net>
- In-Reply-To
- <c9e1d561825a63630a09a2815b9b296c9e4bd1f5.1495014840.git.mhagger@alum.mit.edu>
On Wed, May 17, 2017 at 02:05:28PM +0200, Michael Haggerty wrote:
> The backend already takes care of the prefix. By passing the prefix > again to `prefix_ref_iterator`, we were forcing that iterator to do > redundant prefix comparisons. So set it to the empty string.
Hmm. So givne a refname like "refs/heads/foo" and a prefix like "refs/heads/", would we trim down to "foo" and then further try to remove "refs/heads" again?
That sounds like it's not just redundant, but a bug (albeit one that is very unlikely to come up, unless you have "refs/heads/refs/heads/foo").
Or am I misunderstanding?
-Peff