DORMANTno replies

[PATCH] On Cygwin support both UNIX and DOS style path-names

From: Pascal Obry <hidden>
Date: 2016-06-15 22:51:39
Subsystem: the rest · Maintainer: Linus Torvalds

In fact Cygwin supports both, so make Git agree with this.
The failing case is when a file is committed in a sub-dir of the
repository using a log message from a file specified with a DOS
style path-name. To reproduce:

   $ cd src
   $ git commit -F c:\tmp\log.txt file.c
   fatal: could not read log file 'src/c:\tmp\log.txt': No such file \
   or directory.

Signed-off-by: Pascal Obry <redacted>
---
 compat/cygwin.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/compat/cygwin.h b/compat/cygwin.h
index a3229f5..de9737c 100644
--- a/compat/cygwin.h
+++ b/compat/cygwin.h
@@ -7,3 +7,6 @@ extern stat_fn_t cygwin_lstat_fn;
 
 #define stat(path, buf) (*cygwin_stat_fn)(path, buf)
 #define lstat(path, buf) (*cygwin_lstat_fn)(path, buf)
+
+#define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':')
+#define is_dir_sep(c) ((c) == '/' || (c) == '\\')
-- 
1.7.6.345.g5c2f8
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help