Re: Worktree creation race
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 1, 2019, 18:06 UTC
- Message-ID
- <xmqqh8dnz8mr.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CAPig+cSdpq0Bfq3zSK8kJd6da3dKixK7qYQ24=ZwbuQtsaLNZw@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
> Another possibility would be to skip the stat() and instead do the > mkdir() in a loop, incrementing the sequence number each time through > the loop. That should eliminate the race entirely (I think).
Yeah, I think that is the only sensible option to rely on the atomicity of mkdir() call.