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 0998ea2345..d3a9aab83d 100644 --- a/submodule.c +++ b/submodule.c @@ -1534,6 +1534,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(); @@ -1699,6 +1711,8 @@ int submodule_move_head(const char *path, if (is_empty_dir(path)) rmdir_or_warn(path); + + submodule_unset_core_worktree(sub); } } out: |