diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2022-11-23 13:53:40 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-23 13:53:40 +0000 |
| commit | d0203b6484812a44331e99d6754c955844d49fdb (patch) | |
| tree | df15390edb38bf457a6e9502766c1c02b3cdcca7 /src/libgit2 | |
| parent | 33e1c9853a66896074af0514a88116c2f1422890 (diff) | |
| parent | 594bd70b84247eb5fb4b04defb362496b8c85a2b (diff) | |
| download | libgit2-d0203b6484812a44331e99d6754c955844d49fdb.tar.gz | |
Merge pull request #6429 from csware/safe.directory-wildcard
Add support for "safe.directory *"
Diffstat (limited to 'src/libgit2')
| -rw-r--r-- | src/libgit2/repository.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libgit2/repository.c b/src/libgit2/repository.c index dd443a630..df41f581c 100644 --- a/src/libgit2/repository.c +++ b/src/libgit2/repository.c @@ -498,7 +498,9 @@ static int validate_ownership_cb(const git_config_entry *entry, void *payload) if (strcmp(entry->value, "") == 0) *data->is_safe = false; - if (git_fs_path_prettify_dir(&data->tmp, entry->value, NULL) == 0 && + if (strcmp(entry->value, "*") == 0) + *data->is_safe = true; + else if (git_fs_path_prettify_dir(&data->tmp, entry->value, NULL) == 0 && strcmp(data->tmp.ptr, data->repo_path) == 0) *data->is_safe = true; |
