diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-04-13 22:21:08 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-04-13 22:21:08 (GMT) |
commit | 09f66d65f87e0a547c186e4027368a826a965256 (patch) | |
tree | 8d387d1cc28d85ba1e2f21c56f9efa6537c84aed /setup.c | |
parent | 44de39c45c65134f4a6e02e7702a5db70a71041d (diff) | |
parent | 17083c79ae842b51d82518e2efe5281346acea0e (diff) | |
download | git-9372639dbe7d3302aff2709ce4e362072af59f17.zip git-9372639dbe7d3302aff2709ce4e362072af59f17.tar.gz git-9372639dbe7d3302aff2709ce4e362072af59f17.tar.bz2 |
Git 2.31.3v2.31.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
@@ -1034,9 +1034,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) && @@ -1053,7 +1058,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); |