summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-09-19 14:05:12 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-09-19 14:05:12 -0700
commita28e876b9dafe3f042ae057be84613f4504822b3 (patch)
tree521b4535fcf72c88b7659517707e2b0056c2eaa0 /t
parentMerge branch 'sp/pack-protocol-doc-on-shallow' into maint (diff)
parentcheckout -m: attempt merge when deletion of path was staged (diff)
downloadtgif-a28e876b9dafe3f042ae057be84613f4504822b3.tar.xz
Merge branch 'jn/unpack-trees-checkout-m-carry-deletion' into maint
* jn/unpack-trees-checkout-m-carry-deletion: checkout -m: attempt merge when deletion of path was staged unpack-trees: use 'cuddled' style for if-else cascade unpack-trees: simplify 'all other failures' case
Diffstat (limited to 't')
-rwxr-xr-xt/t7201-co.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 0c9ec0ad44..eae9e5a937 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -223,6 +223,23 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
test_cmp two expect
'
+test_expect_success 'switch to another branch while carrying a deletion' '
+
+ git checkout -f master && git reset --hard && git clean -f &&
+ git rm two &&
+
+ test_must_fail git checkout simple 2>errs &&
+ test_i18ngrep overwritten errs &&
+
+ git checkout --merge simple 2>errs &&
+ test_i18ngrep ! overwritten errs &&
+ git ls-files -u &&
+ test_must_fail git cat-file -t :0:two &&
+ test "$(git cat-file -t :1:two)" = blob &&
+ test "$(git cat-file -t :2:two)" = blob &&
+ test_must_fail git cat-file -t :3:two
+'
+
test_expect_success 'checkout to detach HEAD (with advice declined)' '
git config advice.detachedHead false &&