summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-11 10:33:35 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-11 10:33:36 -0700
commitf28763d7561f66c0c6ff9b5d48146a0f923781d3 (patch)
tree302aba13e921f492b4033477062dbacb3f05628a /t
parent294792326ae86c276897a0fd694948d2fb5640de (diff)
parent6a143aa2b23b97fa8363e2f4fd16f23b4c5b104d (diff)
downloadgit-f28763d7561f66c0c6ff9b5d48146a0f923781d3.tar.gz
Merge branch 'jn/unpack-trees-checkout-m-carry-deletion'
"git checkout -m" did not switch to another branch while carrying the local changes forward when a path was deleted from the index. * 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 &&