diff options
author | Glen Choo <chooglen@google.com> | 2022-10-13 20:43:47 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-10-13 21:39:46 +0300 |
commit | ecec57b3c9731cf81cd1b9d515334168c2c68f5b (patch) | |
tree | dc912af8991cc432622edb77e6a150f67cf819e9 /t/t0033-safe-directory.sh | |
parent | 776f184893d2861a729aa4b91d69931036e03e4b (diff) |
config: respect includes in protected config
Protected config is implemented by reading a fixed set of paths,
which ignores config [include]-s. Replace this implementation with a
call to config_with_options(), which handles [include]-s and saves us
from duplicating the logic of 1) identifying which paths to read and 2)
reading command line config.
As a result, git_configset_add_parameters() is unused, so remove it. It
was introduced alongside protected config in 5b3c650777 (config: learn
`git_protected_config()`, 2022-07-14) as a way to handle command line
config.
Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0033-safe-directory.sh')
-rwxr-xr-x | t/t0033-safe-directory.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t0033-safe-directory.sh b/t/t0033-safe-directory.sh index f4d737dadd..2dec021e0c 100755 --- a/t/t0033-safe-directory.sh +++ b/t/t0033-safe-directory.sh @@ -70,4 +70,13 @@ test_expect_success 'safe.directory=*, but is reset' ' expect_rejected_dir ' +test_expect_success 'safe.directory in included file' ' + cat >gitconfig-include <<-EOF && + [safe] + directory = "$(pwd)" + EOF + git config --global --add include.path "$(pwd)/gitconfig-include" && + git status +' + test_done |