]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/submodule--helper.c
reftable: signal overflow
[thirdparty/git.git] / builtin / submodule--helper.c
index e630f0c730eae7235191957cff3fb814dac33f62..9b25a508e6a7bb6116b48b36ab4b15e8f670552b 100644 (file)
@@ -1503,16 +1503,17 @@ static void deinit_submodule(const char *path, const char *prefix,
                struct strbuf sb_rm = STRBUF_INIT;
                const char *format;
 
-               /*
-                * protect submodules containing a .git directory
-                * NEEDSWORK: instead of dying, automatically call
-                * absorbgitdirs and (possibly) warn.
-                */
-               if (is_directory(sub_git_dir))
-                       die(_("Submodule work tree '%s' contains a .git "
-                             "directory (use 'rm -rf' if you really want "
-                             "to remove it including all of its history)"),
-                           displaypath);
+               if (is_directory(sub_git_dir)) {
+                       if (!(flags & OPT_QUIET))
+                               warning(_("Submodule work tree '%s' contains a .git "
+                                         "directory. This will be replaced with a "
+                                         ".git file by using absorbgitdirs."),
+                                       displaypath);
+
+                       absorb_git_dir_into_superproject(path,
+                                                        ABSORB_GITDIR_RECURSE_SUBMODULES);
+
+               }
 
                if (!(flags & OPT_FORCE)) {
                        struct child_process cp_rm = CHILD_PROCESS_INIT;