From 1be70649432afc0dbac4fdd7d3d50d4881f3c634 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Sat, 18 Feb 2023 12:54:31 -0800 Subject: repo: don't fail on strange win32 paths With some paths on Win32, we cannot identify the owner because it's on a file share (WSL2 or UNC). In that case, don't fail, but identify that the current user does not own the path. This matches Git for Windows behavior. --- src/libgit2/repository.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libgit2') diff --git a/src/libgit2/repository.c b/src/libgit2/repository.c index 489d627a0..c02662bda 100644 --- a/src/libgit2/repository.c +++ b/src/libgit2/repository.c @@ -547,6 +547,9 @@ static int validate_ownership_path(bool *is_safe, const char *path) if (error == GIT_ENOTFOUND) { *is_safe = true; error = 0; + } else if (error == GIT_EINVALID) { + *is_safe = false; + error = 0; } return error; -- cgit v1.2.1