summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-04-13 22:21:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-04-13 22:21:34 (GMT)
commitd516b2db0af2221bd6b13e7347abdcb5830b2829 (patch)
tree5ce8656672734b2dabab1a10747ce6674d139ac5 /setup.c
parent53ef17d3ee0f7fcb151f428ee3bd736b8046825f (diff)
parent2f0dde7852b7866bb044926f73334ff3fc30654b (diff)
downloadgit-2dcfc3c7b3e36ce197c416921c23973a924a9a64.zip
git-2dcfc3c7b3e36ce197c416921c23973a924a9a64.tar.gz
git-2dcfc3c7b3e36ce197c416921c23973a924a9a64.tar.bz2
Git 2.35.3v2.35.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 b03c382..7e5af71 100644
--- a/setup.c
+++ b/setup.c
@@ -1099,9 +1099,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) &&
@@ -1118,7 +1123,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);