{"thread":{"id":"27916","subject":"[PATCH] On Cygwin support both UNIX and DOS style path-names","startedAt":"2011-07-25T17:27:24Z","lastAt":"2011-07-25T17:27:24Z","messageCount":1,"participants":["Pascal Obry"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"171996","messageId":"1311614844-4256-1-git-send-email-pascal@obry.net","threadId":"27916","inReplyTo":null,"subject":"[PATCH] On Cygwin support both UNIX and DOS style path-names","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2011-07-25T17:27:24Z","receivedAt":"2011-07-25T17:27:24Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"In fact Cygwin supports both, so make Git agree with this.\nThe failing case is when a file is committed in a sub-dir of the\nrepository using a log message from a file specified with a DOS\nstyle path-name. To reproduce:\n\n   $ cd src\n   $ git commit -F c:\\tmp\\log.txt file.c\n   fatal: could not read log file 'src/c:\\tmp\\log.txt': No such file \\\n   or directory.\n\nSigned-off-by: Pascal Obry <pascal@obry.net>\n---\n compat/cygwin.h |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/compat/cygwin.h b/compat/cygwin.h\nindex a3229f5..de9737c 100644\n--- a/compat/cygwin.h\n+++ b/compat/cygwin.h\n@@ -7,3 +7,6 @@ extern stat_fn_t cygwin_lstat_fn;\n \n #define stat(path, buf) (*cygwin_stat_fn)(path, buf)\n #define lstat(path, buf) (*cygwin_lstat_fn)(path, buf)\n+\n+#define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':')\n+#define is_dir_sep(c) ((c) == '/' || (c) == '\\\\')\n-- \n1.7.6.345.g5c2f8\n"}]}