From: Per Cederqvist Date: Wed, 18 Apr 2012 08:37:04 GMT Subject: Re: git clone fails intermittently if source repo is updated Message-ID: <4F8E7D30.2010906@opera.com> In-Reply-To: <87vckyldrj.fsf@opera.com> On 04/17/2012 02:54 PM, Per Cederqvist wrote: > Running "git clone master.git copy" sometimes fails if changes are being > pushed to master.git. Likewise, running "git clone mirror.git copy" > sometimes fails if the mirror is currently fetching changes from > master.git. > > In git 1.7.9 I sometimes get one of two fatal error messages. In one of > the cases, git still exits with exit code 0, but the working directory > of "copy" is not updated with the proper files. (See below for the > exact error messages.) > > In git 1.7.10 the mirror sometimes ends up in "detached HEAD" state. > Sometimes it prints a warning message. (See below for the messages.) > > The following shell scripts can reproduce the problem. I've been using > a 4-core CPU on Ubuntu 11.04. I've compiled Git from source. > > The first script, test-git-setup.sh, creates the directory "test-git" > and three git repositories in it: master.git, mirror.git, and committer: > > [...four shellscripts omitted...] For your convenience, I have now set up a Git repository where you can get slightly updated versions of the above scripts. The Gitorious web page is here: http://git.lysator.liu.se/ceder/git-clone-fail-demo You can clone it like this: git clone git://git.lysator.liu.se/ceder/git-clone-fail-demo.git I have been able to reproduce the problem on Git 1.6.0 as well, so this is apparently not a recent regression. The problem can also be reproduces when you clone, push and fetch via ssh, but it happens a lot less frequently then. See the README file in the git-clone-fail-demo repository for info on how to reproduce it. > [...] > > /ceder /ceder