Re: [PATCH v3 29/33] refs: resolve symbolic refs first
- From
Jeff King <peff@peff.net>
- Date
- May 13, 2016, 12:58 UTC
- Message-ID
- <20160513125822.GB24031@sigill.intra.peff.net>
- In-Reply-To
- <e87d7f0f441a9094d75cae7a39aac1e8760426e9.1463140520.git.mhagger@alum.mit.edu>
On Fri, May 13, 2016 at 02:35:40PM +0200, Michael Haggerty wrote:
Show 25 quoted lines
> + if (read_raw_ref(refname, lock->old_oid.hash, referent, type)) {
> + if (errno == ENOENT) {
> + if (mustexist) {
> + /* Garden variety missing reference. */
> + strbuf_addf(err, "unable to resolve reference '%s'",
> + refname);
> + goto error_return;
> + } else {
> + /*
> + * Reference is missing, but that's OK. We
> + * know that there is not a conflict with
> + * another loose reference because
> + * (supposing that we are trying to lock
> + * reference "refs/foo/bar"):
> + *
> + * - We were successfully able to create
> + * the lockfile refs/foo/bar.lock, so we
> + * know there cannot be a loose reference
> + * named "refs/foo".
> + *
> + * - We got ENOENT and not EISDIR, so we
> + * know that there cannot be a loose
> + * reference named "refs/foo/bar/baz".
> + */
> + }Thanks for this comment, I think it makes the logic easier to follow.
I re-ran t5551 and confirmed that the timings look good (though I imagine you might have already done that, too :) ).
-Peff