]> git.ipfire.org Git - thirdparty/git.git/commit
config: respect includes in protected config
authorGlen Choo <chooglen@google.com>
Thu, 13 Oct 2022 17:43:47 +0000 (17:43 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 13 Oct 2022 18:39:46 +0000 (11:39 -0700)
commitecec57b3c9731cf81cd1b9d515334168c2c68f5b
treedc912af8991cc432622edb77e6a150f67cf819e9
parent776f184893d2861a729aa4b91d69931036e03e4b
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>
config.c
t/t0033-safe-directory.sh
t/t0035-safe-bare-repository.sh