diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-04-14 00:26:32 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-04-14 00:26:32 +0200 |
commit | 1ac7422e39b0043250b026f9988d0da24cb2cb58 (patch) | |
tree | 74567e5572ca19683029c3123454c0fcdbdcfe94 /setup.c | |
parent | Git 2.36-rc2 (diff) | |
parent | Git 2.35.3 (diff) | |
download | git-1ac7422e39b0043250b026f9988d0da24cb2cb58.tar.xz git-1ac7422e39b0043250b026f9988d0da24cb2cb58.zip |
Sync with Git 2.35.3
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1100,9 +1100,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) && @@ -1119,7 +1124,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); |