Skip to content

pr-git-1078/mugdhapattnaik/submodule-deinit-absorbgitdirs-v6

From: mugdha <mugdhapattnaik@gmail.com>

Currently, running 'git submodule deinit' on repos where the
submodule's '.git' is a directory, aborts with a message that is not
exactly user friendly. Let's change this to instead warn the user
to rerun the command with '--force'.

This internally calls 'absorb_git_dir_into_superproject()', which
moves the git dir into the superproject and replaces it with
a '.git' file. The rest of the deinit function can operate as it
already does with new-style submodules.

We also edit a test case such that it matches the new behaviour of
deinit.

Suggested-by: Atharva Raykar <raykar.ath@gmail.com>
Signed-off-by: Mugdha Pattnaik <mugdhapattnaik@gmail.com>

Submitted-As: https://lore.kernel.org/git/pull.1078.v6.git.git.1633523057369.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1078.git.git.1630002794889.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1078.v2.git.git.1630044219145.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1078.v3.git.git.1630087821429.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1078.v4.git.git.1630090303445.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1078.v5.git.git.1633521772731.gitgitgadget@gmail.com
Assets 2