Re: [PATCH 3/9] submodule: add gitdir path config override
- From
Josh Steadmon <steadmon@google.com>
- Date
- Aug 20, 2025, 21:38 UTC
- Message-ID
- <3hzj6k4yxfcvpt33jkblcafljhbj5npjia2u7sprqbkfcxoxwa@6qmaqwj3x7hc>
- In-Reply-To
- <20250816213642.3517822-4-adrian.ratiu@collabora.com>
On 2025.08.17 00:36, Adrian Ratiu wrote: [snip]
Show 30 quoted lines
> 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 ...`