From: Adrian Ratiu Date: Thu, 21 Aug 2025 13:04:03 GMT Subject: Re: [PATCH 3/9] submodule: add gitdir path config override Message-ID: <871pp4967w.fsf@collabora.com> In-Reply-To: <3hzj6k4yxfcvpt33jkblcafljhbj5npjia2u7sprqbkfcxoxwa@6qmaqwj3x7hc> On Wed, 20 Aug 2025, Josh Steadmon wrote: > On 2025.08.17 00:36, Adrian Ratiu wrote: [snip] >> diff --git a/t/t7400-submodule-basic.sh >> b/t/t7400-submodule-basic.sh index 178c386212..f4d4fb8397 >> 100755 --- a/t/t7400-submodule-basic.sh +++ >> b/t/t7400-submodule-basic.sh @@ -13,6 +13,7 @@ >> GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main >> export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh >> +. "$TEST_DIRECTORY"/lib-verify-submodule-gitdir-path.sh >> test_expect_success 'setup - enable local submodules' ' git >> config --global protocol.file.allow always >> @@ -1505,4 +1506,18 @@ test_expect_success 'submodule add fails >> when name is reused' ' >> ) ' >> +test_expect_success 'submodule helper gitdir config overrides' >> ' + verify_submodule_gitdir_path test-submodule child >> submodules/child && + ( + cd test-submodule >> && + git config submodule.child.gitdirpath >> ".git/submodules/custom-child" + ) && + >> verify_submodule_gitdir_path test-submodule child >> submodules/custom-child && + ( + cd test-submodule >> && + git config --unset submodule.child.gitdirpath + ) >> && + verify_submodule_gitdir_path test-submodule child >> submodules/child +' + > > Rather than `( cd test-submodule && git config ... )` here, you > should use `test_config -C test-submodule ...` and > `test_unconfig -C test-submodule ...` ack, will do in v2.