Merge branch 'rs/use-strbuf-complete-line'
[gitweb.git] / t / t7201-co.sh
index 0c9ec0ad44ef4e3239e67a0c9e9ecc1340dcee8a..eae9e5a937150d60002620c8b29293f4d7ed122f 100755 (executable)
@@ -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 &&