diff options
Diffstat (limited to 'compat/cygwin.c')
-rw-r--r-- | compat/cygwin.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/compat/cygwin.c b/compat/cygwin.c index 5428858875..91ce5d4c7a 100644 --- a/compat/cygwin.c +++ b/compat/cygwin.c @@ -1,15 +1,23 @@ +#define CYGWIN_C #define WIN32_LEAN_AND_MEAN -#ifdef CYGWIN_V15_WIN32API -#include "../git-compat-util.h" -#include "win32.h" -#else #include <sys/stat.h> #include <sys/errno.h> #include "win32.h" #include "../git-compat-util.h" -#endif #include "../cache.h" /* to read configuration */ +/* + * Return POSIX permission bits, regardless of core.ignorecygwinfstricks + */ +int cygwin_get_st_mode_bits(const char *path, int *mode) +{ + struct stat st; + if (lstat(path, &st) < 0) + return -1; + *mode = st.st_mode; + return 0; +} + static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts) { long long winTime = ((long long)ft->dwHighDateTime << 32) + |