-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
Reproduction steps
Use Windows, open a repository on a network share.
Whitelist that directory with a prefix of %(prefix)/
Based on the Git error message %(prefix)/
should be used for network shares, but nowadays (Git 2.43) it also works without... I asked which one is the recommended way.
The stripped test_path is never used:
libgit2/src/libgit2/repository.c
Lines 604 to 612 in 8535fdb
if (strncmp(test_path, "%(prefix)//", strlen("%(prefix)//")) == 0) | |
test_path += strlen("%(prefix)/"); | |
else if (strncmp(test_path, "//", 2) == 0 && | |
strncmp(test_path, "//wsl.localhost/", strlen("//wsl.localhost/")) != 0) | |
test_path++; | |
#endif | |
if (strcmp(data->tmp.ptr, data->repo_path) == 0) | |
*data->is_safe = true; |
PR #6668 contained a working fix (which requires %(prefix)/
for network shares), but the changes applied to main (commit 516749f) are incomplete (the latest version of that PR also avoided additional copies).
Expected behavior
The safe.directory exception is accepted
Actual behavior
The safe.directory exception doesn't match
Version of libgit2 (release number or SHA1)
Operating system(s) tested
Windows 10
Metadata
Metadata
Assignees
Labels
No labels