From: Jeff King Date: Wed, 05 Jan 2011 22:57:52 GMT Subject: Re: concurrent fetches to update same mirror Message-ID: <20110105225752.GA9774@sigill.intra.peff.net> In-Reply-To: <4D24F3E9.3070904@gmail.com> On Wed, Jan 05, 2011 at 04:42:49PM -0600, Neal Kreitzinger wrote: > In the case of concurrent pulls to the same non-bare repo, could the > working tree or index get corrupted, or does git have concurrency > control mechanisms for this too? There's a lock on the index, so it shouldn't be corruptable; one process will just end up waiting. I'm not sure offhand whether writing working tree files is done under any lock, but I would tend to think not, since it can be a long process. However, writing the same file twice should be OK; we unlink the old version and create the new from scratch. So the first writer will get its write-in-progress unlinked, and the second one will "win". -Peff