"git rm" used to refuse to remove a submodule when it has its own
git repository embedded in its working tree. It learned to move
the repository away to $GIT_DIR/modules/ of the superproject
instead, and allow the submodule to be deleted (as long as there
will be no loss of local modifications, that is).
* sb/submodule-rm-absorb:
rm: absorb a submodules git dir before deletion
submodule: rename and add flags to ok_to_remove_submodule
submodule: modernize ok_to_remove_submodule to use argv_array
submodule.h: add extern keyword to functions
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
@ -667,24 +663,19 @@ test_expect_success 'rm of a populated nested submodule with a nested .git direc
@@ -667,24 +663,19 @@ test_expect_success 'rm of a populated nested submodule with a nested .git direc
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' '