diff options
Diffstat (limited to 't/t3007-ls-files-recurse-submodules.sh')
-rwxr-xr-x | t/t3007-ls-files-recurse-submodules.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t3007-ls-files-recurse-submodules.sh b/t/t3007-ls-files-recurse-submodules.sh index dd7770e85d..7308a3d4e2 100755 --- a/t/t3007-ls-files-recurse-submodules.sh +++ b/t/t3007-ls-files-recurse-submodules.sh @@ -299,6 +299,39 @@ test_expect_success '--recurse-submodules does not support --error-unmatch' ' test_i18ngrep "does not support --error-unmatch" actual ' +test_expect_success '--recurse-submodules parses submodule repo config' ' + test_config -C submodule index.sparse "invalid non-boolean value" && + test_must_fail git ls-files --recurse-submodules 2>err && + grep "bad boolean config value" err +' + +test_expect_success '--recurse-submodules parses submodule worktree config' ' + test_config -C submodule extensions.worktreeConfig true && + test_config -C submodule --worktree index.sparse "invalid non-boolean value" && + + test_must_fail git ls-files --recurse-submodules 2>err && + grep "bad boolean config value" err +' + +test_expect_success '--recurse-submodules submodules ignore super project worktreeConfig extension' ' + # Enable worktree config in both super project & submodule, set an + # invalid config in the submodule worktree config + test_config extensions.worktreeConfig true && + test_config -C submodule extensions.worktreeConfig true && + test_config -C submodule --worktree index.sparse "invalid non-boolean value" && + + # Now, disable the worktree config in the submodule. Note that we need + # to manually re-enable extensions.worktreeConfig when the test is + # finished, otherwise the test_unconfig of index.sparse will not work. + test_unconfig -C submodule extensions.worktreeConfig && + test_when_finished "git -C submodule config extensions.worktreeConfig true" && + + # With extensions.worktreeConfig disabled in the submodule, the invalid + # worktree config is not picked up. + git ls-files --recurse-submodules 2>err && + ! grep "bad boolean config value" err +' + test_incompatible_with_recurse_submodules () { test_expect_success "--recurse-submodules and $1 are incompatible" " test_must_fail git ls-files --recurse-submodules $1 2>actual && |