From bb50ec3cc300eeff3aba7a2bea145aabdb477d31 Mon Sep 17 00:00:00 2001 From: Matheus Valadares Date: Wed, 13 Apr 2022 15:32:30 +0000 Subject: 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 Signed-off-by: Derrick Stolee Signed-off-by: Junio C Hamano --- t/t0033-safe-directory.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 't') diff --git a/t/t0033-safe-directory.sh b/t/t0033-safe-directory.sh index 9380ff3d01..6f33c0dfef 100755 --- a/t/t0033-safe-directory.sh +++ b/t/t0033-safe-directory.sh @@ -21,6 +21,11 @@ test_expect_success 'safe.directory does not match' ' expect_rejected_dir ' +test_expect_success 'path exist as different key' ' + git config --global foo.bar "$(pwd)" && + expect_rejected_dir +' + test_expect_success 'safe.directory matches' ' git config --global --add safe.directory "$(pwd)" && git status -- cgit v1.2.3