From: Pascal Obry <pascal@obry.net>
To: git@vger.kernel.org
Cc: Pascal Obry <pascal@obry.net>
Subject: [PATCH] On Cygwin support both UNIX and DOS style path-names
Date: Mon, 25 Jul 2011 19:27:24 +0200 [thread overview]
Message-ID: <1311614844-4256-1-git-send-email-pascal@obry.net> (raw)
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 <pascal@obry.net>
---
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
next reply other threads:[~2011-07-25 17:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-25 17:27 Pascal Obry [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-07-27 15:57 [PATCH] On Cygwin support both UNIX and DOS style path-names Theo Niessink
2011-07-28 9:28 ` Pascal Obry
2011-07-28 10:44 ` Theo Niessink
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1311614844-4256-1-git-send-email-pascal@obry.net \
--to=pascal@obry.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).