summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-05-14 11:42:49 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-05-14 11:42:50 -0700
commit3734dbc4abce39c20530e36c2d47d3269ac0e6cd (patch)
treeabe8461ee17211ec971a57831d118288e260f691 /t
parentMerge branch 'jk/maint-tformat-with-z' into maint (diff)
parentcheckout: do not corrupt HEAD on empty repo (diff)
downloadtgif-3734dbc4abce39c20530e36c2d47d3269ac0e6cd.tar.xz
Merge branch 'ef/checkout-empty' into maint
Running "git checkout" on an unborn branch used to corrupt HEAD (regression in 1.7.10); this makes it error out. By Erik Faye-Lund * ef/checkout-empty: checkout: do not corrupt HEAD on empty repo
Diffstat (limited to 't')
-rwxr-xr-xt/t2015-checkout-unborn.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t2015-checkout-unborn.sh b/t/t2015-checkout-unborn.sh
index 6352b74e2e..37bdcedcc9 100755
--- a/t/t2015-checkout-unborn.sh
+++ b/t/t2015-checkout-unborn.sh
@@ -46,4 +46,15 @@ test_expect_success 'checking out another branch from unborn state' '
test_cmp expect actual
'
+test_expect_success 'checking out in a newly created repo' '
+ test_create_repo empty &&
+ (
+ cd empty &&
+ git symbolic-ref HEAD >expect &&
+ test_must_fail git checkout &&
+ git symbolic-ref HEAD >actual &&
+ test_cmp expect actual
+ )
+'
+
test_done