docs/diff-options: clarify scope of diff-filter types
[gitweb.git] / t / t3600-rm.sh
index bcbb68065113f6a2032a3879fabb3353c42e79d0..3c63455729c9bad8aae1210172225e5fb1aab229 100755 (executable)
@@ -569,26 +569,22 @@ test_expect_success 'rm of a conflicted unpopulated submodule succeeds' '
        test_cmp expect actual
 '
 
-test_expect_success 'rm of a populated submodule with a .git directory fails even when forced' '
+test_expect_success 'rm of a populated submodule with a .git directory migrates git dir' '
        git checkout -f master &&
        git reset --hard &&
        git submodule update &&
        (cd submod &&
                rm .git &&
                cp -R ../.git/modules/sub .git &&
-               GIT_WORK_TREE=. git config --unset core.worktree
+               GIT_WORK_TREE=. git config --unset core.worktree &&
+               rm -r ../.git/modules/sub
        ) &&
-       test_must_fail git rm submod &&
-       test -d submod &&
-       test -d submod/.git &&
-       git status -s -uno --ignore-submodules=none >actual &&
-       ! test -s actual &&
-       test_must_fail git rm -f submod &&
-       test -d submod &&
-       test -d submod/.git &&
+       git rm submod 2>output.err &&
+       ! test -d submod &&
+       ! test -d submod/.git &&
        git status -s -uno --ignore-submodules=none >actual &&
-       test -s actual &&
-       rm -rf submod
+       test -s actual &&
+       test_i18ngrep Migrating output.err
 '
 
 cat >expect.deepmodified <<EOF
@@ -662,29 +658,24 @@ test_expect_success 'rm of a populated nested submodule with nested untracked fi
        test_cmp expect actual
 '
 
-test_expect_success 'rm of a populated nested submodule with a nested .git directory fails even when forced' '
+test_expect_success "rm absorbs submodule's nested .git directory" '
        git reset --hard &&
        git submodule update --recursive &&
        (cd submod/subsubmod &&
                rm .git &&
-               cp -R ../../.git/modules/sub/modules/sub .git &&
+               mv ../../.git/modules/sub/modules/sub .git &&
                GIT_WORK_TREE=. git config --unset core.worktree
        ) &&
-       test_must_fail git rm submod &&
-       test -d submod &&
-       test -d submod/subsubmod/.git &&
-       git status -s -uno --ignore-submodules=none >actual &&
-       ! test -s actual &&
-       test_must_fail git rm -f submod &&
-       test -d submod &&
-       test -d submod/subsubmod/.git &&
+       git rm submod 2>output.err &&
+       ! test -d submod &&
+       ! test -d submod/subsubmod/.git &&
        git status -s -uno --ignore-submodules=none >actual &&
-       test -s actual &&
-       rm -rf submod
+       test -s actual &&
+       test_i18ngrep Migrating output.err
 '
 
 test_expect_success 'checking out a commit after submodule removal needs manual updates' '
-       git commit -m "submodule removal" submod &&
+       git commit -m "submodule removal" submod .gitmodules &&
        git checkout HEAD^ &&
        git submodule update &&
        git checkout -q HEAD^ &&