From: Junio C Hamano Date: Tue, 08 May 2012 17:13:05 GMT Subject: Re: [PATCH] checkout: do not corrupt HEAD on empty repo Message-ID: <7v8vh2wq8u.fsf@alter.siamese.dyndns.org> In-Reply-To: Erik Faye-Lund writes: > On Tue, May 8, 2012 at 6:43 PM, Junio C Hamano wrote: > ... >> Hrm, I am of two minds.  Yes, we may want checkout to fail, but at the >> same time, we would want to make sure that a failed checkout does not >> corrupt the HEAD. > > Good point. > >>  Perhaps it would make it more palatable if you replaced >> "cat .git/HEAD" with "git symbolic-ref HEAD" in the original? > > Ah, yes. That's much better. Do you want me to resend (improving the > test and replacing "CRT" with "vsnprintf")? I also spotted a typo in > the commit message ("crasheed" vs "crashed")... Surely. By the way, notice I said "we *may* want checkout to fail"? With the discussion "why is it wrong to allow 'git checkout' to be no-op in a freshly created repository" stemming from your other "I do not claim it is correct but it makes the test pass" message, we may actually want to make that 'checkout' in the test pass, and then 'test_must_fail git checkout' in the test would have to go when that happens.