summaryrefslogtreecommitdiff
path: root/builtin/submodule--helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r--builtin/submodule--helper.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index e630f0c..c5d3fc3 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -1313,7 +1313,7 @@ static int module_summary(int argc, const char **argv, const char *prefix)
if (files) {
if (cached)
- die(_("--cached and --files are mutually exclusive"));
+ die(_("options '%s' and '%s' cannot be used together"), "--cached", "--files");
diff_cmd = DIFF_FILES;
}
@@ -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;
@@ -2971,7 +2972,7 @@ static int module_set_branch(int argc, const char **argv, const char *prefix)
die(_("--branch or --default required"));
if (opt_branch && opt_default)
- die(_("--branch and --default are mutually exclusive"));
+ die(_("options '%s' and '%s' cannot be used together"), "--branch", "--default");
if (argc != 1 || !(path = argv[0]))
usage_with_options(usage, options);