aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarsten Blees <karsten.blees@gmail.com>2026-01-09 20:05:06 +0000
committerJunio C Hamano <gitster@pobox.com>2026-01-09 18:32:55 -0800
commit9ac15c2ae3d4d7caf27444930f2e3d12a6eebee8 (patch)
treeb7e3c637155f3b5fd4b7b499eaab7095583d4c6e
parent1bf1ffadc862c072e6cf27c67fcc72d4da23a492 (diff)
downloadgit-9ac15c2ae3d4d7caf27444930f2e3d12a6eebee8.tar.xz
mingw: add symlink-specific error codes
The Win32 API calls do not set `errno`; Instead, error codes for failed operations must be obtained via the `GetLastError()` function. Git would not know what to do with those error values, though, which is why Git's Windows compatibility layer translates them to `errno` values. Let's handle a couple of symlink-related error codes that will become relevant with the upcoming support for symlinks on Windows. Signed-off-by: Karsten Blees <karsten.blees@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--compat/mingw.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 0fe00a5b70..0e8807196f 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -102,6 +102,7 @@ int err_win_to_posix(DWORD winerr)
case ERROR_INVALID_PARAMETER: error = EINVAL; break;
case ERROR_INVALID_PASSWORD: error = EPERM; break;
case ERROR_INVALID_PRIMARY_GROUP: error = EINVAL; break;
+ case ERROR_INVALID_REPARSE_DATA: error = EINVAL; break;
case ERROR_INVALID_SIGNAL_NUMBER: error = EINVAL; break;
case ERROR_INVALID_TARGET_HANDLE: error = EIO; break;
case ERROR_INVALID_WORKSTATION: error = EACCES; break;
@@ -116,6 +117,7 @@ int err_win_to_posix(DWORD winerr)
case ERROR_NEGATIVE_SEEK: error = ESPIPE; break;
case ERROR_NOACCESS: error = EFAULT; break;
case ERROR_NONE_MAPPED: error = EINVAL; break;
+ case ERROR_NOT_A_REPARSE_POINT: error = EINVAL; break;
case ERROR_NOT_ENOUGH_MEMORY: error = ENOMEM; break;
case ERROR_NOT_READY: error = EAGAIN; break;
case ERROR_NOT_SAME_DEVICE: error = EXDEV; break;
@@ -136,6 +138,9 @@ int err_win_to_posix(DWORD winerr)
case ERROR_PIPE_NOT_CONNECTED: error = EPIPE; break;
case ERROR_PRIVILEGE_NOT_HELD: error = EACCES; break;
case ERROR_READ_FAULT: error = EIO; break;
+ case ERROR_REPARSE_ATTRIBUTE_CONFLICT: error = EINVAL; break;
+ case ERROR_REPARSE_TAG_INVALID: error = EINVAL; break;
+ case ERROR_REPARSE_TAG_MISMATCH: error = EINVAL; break;
case ERROR_SEEK: error = EIO; break;
case ERROR_SEEK_ON_DEVICE: error = ESPIPE; break;
case ERROR_SHARING_BUFFER_EXCEEDED: error = ENFILE; break;