aboutsummaryrefslogtreecommitdiffstats
path: root/setup.c
diff options
context:
space:
mode:
authorMatheus Valadares <me@m28.io>2022-04-13 15:32:30 +0000
committerJunio C Hamano <gitster@pobox.com>2022-04-13 12:42:51 -0700
commitbb50ec3cc300eeff3aba7a2bea145aabdb477d31 (patch)
tree413c5d0a2a2241e945ce6f60902586772b507dfb /setup.c
parente47363e5a8bdf5144059d664c45c0975243ef05b (diff)
downloadgit-bb50ec3cc300eeff3aba7a2bea145aabdb477d31.tar.gz
setup: fix safe.directory key not being checked
It seems that nothing is ever checking to make sure the safe directories in the configs actually have the key safe.directory, so some unrelated config that has a value with a certain directory would also make it a safe directory. Signed-off-by: Matheus Valadares <me@m28.io> Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/setup.c b/setup.c
index 3c6ed17af9..4b9f073617 100644
--- a/setup.c
+++ b/setup.c
@@ -1034,6 +1034,9 @@ static int safe_directory_cb(const char *key, const char *value, void *d)
{
struct safe_directory_data *data = d;
+ if (strcmp(key, "safe.directory"))
+ return 0;
+
if (!value || !*value)
data->is_safe = 0;
else {