diff options
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/submodule.c b/submodule.c index 939d6870ec..e127c074b0 100644 --- a/submodule.c +++ b/submodule.c @@ -1532,6 +1532,18 @@ out: return ret; } +void submodule_unset_core_worktree(const struct submodule *sub) +{ + char *config_path = xstrfmt("%s/modules/%s/config", + get_git_common_dir(), sub->name); + + if (git_config_set_in_file_gently(config_path, "core.worktree", NULL)) + warning(_("Could not unset core.worktree setting in submodule '%s'"), + sub->path); + + free(config_path); +} + static const char *get_super_prefix_or_empty(void) { const char *s = get_super_prefix(); @@ -1697,6 +1709,8 @@ int submodule_move_head(const char *path, if (is_empty_dir(path)) rmdir_or_warn(path); + + submodule_unset_core_worktree(sub); } } out: |