Re: [PATCH v3 29/33] refs: resolve symbolic refs first

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 13, 2016 at 02:35:40PM +0200, Michael Haggerty wrote:

> +	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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]