summaryrefslogtreecommitdiff
path: root/t/t7201-co.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-09-21 23:50:05 -0700
committerJunio C Hamano <gitster@pobox.com>2008-09-21 23:50:05 -0700
commit666599d798102df2d7b32196cadb7dfb737e0b32 (patch)
tree21db458120cf33e1031f135f060d21805d3bb825 /t/t7201-co.sh
parent494202524f76ac0385ae483abf970c4c9c692a77 (diff)
parent352eadc40024b141e1295693654ec20cc123844f (diff)
downloadgit-666599d798102df2d7b32196cadb7dfb737e0b32.tar.gz
Merge branch 'db/maint-checkout-b'
* db/maint-checkout-b: Check early that a new branch is new and valid
Diffstat (limited to 't/t7201-co.sh')
-rwxr-xr-xt/t7201-co.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 25181388f8..62d73f934a 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -391,4 +391,14 @@ test_expect_success 'checkout an unmerged path should fail' '
test_cmp sample file
'
+test_expect_success 'failing checkout -b should not break working tree' '
+ git reset --hard master &&
+ git symbolic-ref HEAD refs/heads/master &&
+ test_must_fail git checkout -b renamer side^ &&
+ test $(git symbolic-ref HEAD) = refs/heads/master &&
+ git diff --exit-code &&
+ git diff --cached --exit-code
+
+'
+
test_done