diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-04-13 15:21:31 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-04-13 15:21:31 -0700 |
commit | 2f0dde7852b7866bb044926f73334ff3fc30654b (patch) | |
tree | f0dfa3cb9c28475d7d3bd80a2572d4e4751e3bf7 /setup.c | |
parent | 4d0b43aa765a0056c88381eea862364c95e358ca (diff) | |
parent | 1f65dd6ae635f77c588ac432cad1a299723d00d6 (diff) |
Git 2.34.3v2.34.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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); |