Re: [PATCH 1/4] resolve_ref: close race condition for packed refs

2013-05-15 Thread Michael Haggerty
On 05/16/2013 05:47 AM, Jeff King wrote: >> I probably would have separated the rest of the patch, which is a pure >> refactoring, from this last chunk, which is a functional change. But >> that's just me. > > Yeah, I go back and forth on whether it is better to have strict > refactors followed b

Re: [PATCH 1/4] resolve_ref: close race condition for packed refs

2013-05-15 Thread Jeff King
On Mon, May 13, 2013 at 12:56:05AM +0200, Michael Haggerty wrote: > > + * This should be called from resolve_ref_unsafe when a loose ref cannot be > > + * accessed; err must represent the errno from the last attempt to access > > the > > + * loose ref, and the other options are forwarded from >

Re: [PATCH 1/4] resolve_ref: close race condition for packed refs

2013-05-12 Thread Michael Haggerty
On 05/07/2013 04:38 AM, Jeff King wrote: > [...] > This patch solves it by factoring out the fallback code from > the lstat() case and calling it from both places. We do not > need to do the same thing for the symlink/readlink code > path, even though it might receive ENOENT, too, because > symlink

Re: [PATCH 1/4] resolve_ref: close race condition for packed refs

2013-05-12 Thread Michael Haggerty
On 05/07/2013 04:38 AM, Jeff King wrote: > When we attempt to resolve a ref, the first thing we do is > call lstat() to see if it is a symlink or a real ref. If we > find that the ref is missing, we fall back to looking it up > in the packed-refs file. If we find the loose ref does exist > (and is