summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-04-13 22:21:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-04-13 22:21:28 (GMT)
commit1f65dd6ae635f77c588ac432cad1a299723d00d6 (patch)
treed276b872a065585c0c85c1f4c2d0d544e46fd7ba /setup.c
parent87ed4fc046840706138d46e0033a009e74c3887a (diff)
parent15304344342b7c888f732d28f908890d874bcb0c (diff)
downloadgit-5e18c82bb9ac28d482413466150f08a7d49230e9.zip
git-5e18c82bb9ac28d482413466150f08a7d49230e9.tar.gz
git-5e18c82bb9ac28d482413466150f08a7d49230e9.tar.bz2
Git 2.33.3v2.33.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/setup.c b/setup.c
index 2ed94ba..a9161ac 100644
--- a/setup.c
+++ b/setup.c
@@ -1035,9 +1035,14 @@ static int safe_directory_cb(const char *key, const char *value, void *d)
{
struct safe_directory_data *data = d;
- if (!value || !*value)
+ if (strcmp(key, "safe.directory"))
+ return 0;
+
+ if (!value || !*value) {
data->is_safe = 0;
- else {
+ } else if (!strcmp(value, "*")) {
+ data->is_safe = 1;
+ } else {
const char *interpolated = NULL;
if (!git_config_pathname(&interpolated, key, value) &&
@@ -1054,7 +1059,8 @@ static int ensure_valid_ownership(const char *path)
{
struct safe_directory_data data = { .path = path };
- if (is_path_owned_by_current_user(path))
+ if (!git_env_bool("GIT_TEST_ASSUME_DIFFERENT_OWNER", 0) &&
+ is_path_owned_by_current_user(path))
return 1;
read_very_early_config(safe_directory_cb, &data);