git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Erik Faye-Lund <kusmabite@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, j.sixt@viscovery.net, schwab@linux-m68k.org
Subject: Re: [PATCH] checkout: do not corrupt HEAD on empty repo
Date: Tue, 8 May 2012 18:52:11 +0200	[thread overview]
Message-ID: <CABPQNSbyh8oMfz8GbDDn_bdLc8RpEt5sq7wxtVFh61ekD_j8yQ@mail.gmail.com> (raw)
In-Reply-To: <7vsjfawrmw.fsf@alter.siamese.dyndns.org>

On Tue, May 8, 2012 at 6:43 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Erik Faye-Lund <kusmabite@gmail.com> writes:
>
>> Hmh, this is needlessly cluttery. The following should cover it:
>>
>> ---
>> diff --git a/t/t2015-checkout-unborn.sh b/t/t2015-checkout-unborn.sh
>> index 2fa9458..b49fedf 100755
>> --- a/t/t2015-checkout-unborn.sh
>> +++ b/t/t2015-checkout-unborn.sh
>> @@ -50,10 +50,7 @@ test_expect_success 'checking out in a newly created repo' '
>>       test_create_repo empty &&
>>       (
>>               cd empty &&
>> -             cat .git/HEAD >expect &&
>> -             test_must_fail git checkout &&
>> -             cat .git/HEAD >actual &&
>> -             test_cmp expect actual
>> +             test_must_fail git checkout
>>       )
>>  '
>
> 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")...

  reply	other threads:[~2012-05-08 16:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-08 16:05 [PATCH] checkout: do not corrupt HEAD on empty repo Erik Faye-Lund
2012-05-08 16:25 ` Erik Faye-Lund
2012-05-08 16:43   ` Junio C Hamano
2012-05-08 16:52     ` Erik Faye-Lund [this message]
2012-05-08 17:13       ` Junio C Hamano
2012-05-08 16:29 ` Junio C Hamano
2012-05-08 16:35   ` Erik Faye-Lund
2012-05-08 16:41     ` Junio C Hamano
2012-05-08 16:43       ` Erik Faye-Lund
2012-05-08 17:33         ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABPQNSbyh8oMfz8GbDDn_bdLc8RpEt5sq7wxtVFh61ekD_j8yQ@mail.gmail.com \
    --to=kusmabite@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).