]> git.ipfire.org Git - thirdparty/git.git/commit
submodule: absorb git dir instead of dying on deinit
authorMugdha Pattnaik <mugdhapattnaik@gmail.com>
Fri, 19 Nov 2021 10:56:27 +0000 (10:56 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Nov 2021 17:19:54 +0000 (09:19 -0800)
commit0adc8ba6ae2b76501f4e0e57cc83d79be5305418
tree261bf0f4f457b20900d7d62e39152e83bf9d339d
parent106298f7f9cca4158a980de149ef217751e1f943
submodule: absorb git dir instead of dying on deinit

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 that the .git/ directory
has been absorbed into the superproject.
The rest of the deinit function can operate as it already does with
new-style submodules.

In one test, we used to require "git submodule deinit" to fail even
with the "--force" option when the submodule's .git/ directory is not
absorbed. Adjust it to expect the operation to pass.

Suggested-by: Atharva Raykar <raykar.ath@gmail.com>
Signed-off-by: Mugdha Pattnaik <mugdhapattnaik@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c
t/t7400-submodule-basic.sh