Re: [PATCH] checkout: do not corrupt HEAD on empty repo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Erik Faye-Lund <kusmabite@xxxxxxxxx> writes:

> Hmh, this is needlessly cluttery. The following should cover it:
> ---
> diff --git a/t/ b/t/
> index 2fa9458..b49fedf 100755
> --- a/t/
> +++ b/t/
> @@ -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.  Perhaps it would make it more palatable if you replaced
"cat .git/HEAD" with "git symbolic-ref HEAD" in the original?

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[Newbies FAQ]     [Linux Kernel Development]     [Free Online Dating]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Free Online Dating]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]     [Linux Resources]

Add to Google