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 /t/lib-submodule-update.sh | |
| 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 't/lib-submodule-update.sh')
| -rwxr-xr-x | t/lib-submodule-update.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh index 016391723c..5b56b23166 100755 --- a/t/lib-submodule-update.sh +++ b/t/lib-submodule-update.sh @@ -235,7 +235,7 @@ reset_work_tree_to_interested () { then mkdir -p submodule_update/.git/modules/sub1/modules && cp -r submodule_update_repo/.git/modules/sub1/modules/sub2 submodule_update/.git/modules/sub1/modules/sub2 - GIT_WORK_TREE=. git -C submodule_update/.git/modules/sub1/modules/sub2 config --unset core.worktree + # core.worktree is unset for sub2 as it is not checked out fi && # indicate we are interested in the submodule: git -C submodule_update config submodule.sub1.url "bogus" && @@ -709,7 +709,8 @@ test_submodule_recursing_with_args_common() { git branch -t remove_sub1 origin/remove_sub1 && $command remove_sub1 && test_superproject_content origin/remove_sub1 && - ! test -e sub1 + ! test -e sub1 && + test_must_fail git config -f .git/modules/sub1/config core.worktree ) ' # ... absorbing a .git directory along the way. |
