Thread (17 messages) 17 messages, 5 authors, 2016-06-15

Re: [PATCH] t1410: fix breakage on case-insensitive filesystems

From: Jeff King <hidden>
Date: 2016-06-15 23:02:56

On Fri, Nov 14, 2014 at 08:11:18PM +0100, Johannes Sixt wrote:
Not a comment, on this paragraph of yours, but while I was walking
through the code with gdb, I was wondering why the reflog directory is
being touched at all when core.logallrefupdates is off (in
log_ref_setup via log_ref_write). With the patch below I now get the
same unlink warning as on Linux.
It's because of the weird reflog rules: we will use a reflog file that
exists (no matter what core.logallrefupdates says), but only _create_ a
new one if the config tells us to. I think this dates back to the origin
of reflogs, where we weren't sure at first that you would always want
them on.
quoted hunk ↗ jump to hunk
--- 8< ---
Subject: [PATCH] Windows: correct detection of EISDIR in mingw_open()

According to the Linux open(2) man page, open() returns EISDIR if a
directory was attempted to be opened for writing. Our emulation in
mingw_open() does not get this right: it checks only for O_CREAT. Fix
it to check for one of the write flags.

This fixes a failure in reflog handling, which opens files with
O_APPEND|O_WRONLY, but without O_CREAT, and expects EISDIR when the
named file happens to be a directory.
Ah, so we do get EISDIR with O_CREAT. Which explains why the first test
passed and the second failed (we only pass O_CREAT when logallrefupdates
is on). The behavior you saw (and this fix) make perfect sense to me
then.
Signed-off-by: Johannes Sixt <redacted>
I am not sure if I get to Acked-by things in compat/mingw, but I am
pretty sure this is the right fix. :)

-Peff

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "Git for Windows" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help