diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-01-18 13:49:53 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-01-18 13:49:53 -0800 |
| commit | 3942920966b4392c52c09f66dda391d9c330f0f7 (patch) | |
| tree | d1245dc0d86064a3450d1b08beb4207cf0f8458d /builtin/submodule--helper.c | |
| parent | 1ed943e9ae5172088654f25b0a35c8425eee9b2f (diff) | |
| parent | 8eda5efa1269a6117b86a97a309eb3a195b5f087 (diff) | |
| download | git-3942920966b4392c52c09f66dda391d9c330f0f7.tar.gz | |
Merge branch 'sb/submodule-unset-core-worktree-when-worktree-is-lost'
The core.worktree setting in a submodule repository should not be
pointing at a directory when the submodule loses its working tree
(e.g. getting deinit'ed), but the code did not properly maintain
this invariant.
* sb/submodule-unset-core-worktree-when-worktree-is-lost:
submodule deinit: unset core.worktree
submodule--helper: fix BUG message in ensure_core_worktree
submodule: unset core.worktree if no working tree is present
submodule update: add regression test with old style setups
Diffstat (limited to 'builtin/submodule--helper.c')
| -rw-r--r-- | builtin/submodule--helper.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 0c5b2eb5fc..6881b6a9cb 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -1131,6 +1131,8 @@ static void deinit_submodule(const char *path, const char *prefix, if (!(flags & OPT_QUIET)) printf(format, displaypath); + submodule_unset_core_worktree(sub); + strbuf_release(&sb_rm); } @@ -2046,7 +2048,7 @@ static int ensure_core_worktree(int argc, const char **argv, const char *prefix) struct repository subrepo; if (argc != 2) - BUG("submodule--helper connect-gitdir-workingtree <name> <path>"); + BUG("submodule--helper ensure-core-worktree <path>"); path = argv[1]; |
