Fix working directory errno handling when unlinking a directory
commit851c603e9ca9d0954d89be1532d924a28ccb79fa
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 20 Apr 2007 05:48:21 +0000 (19 22:48 -0700)
committerJunio C Hamano <junkio@cox.net>
Fri, 20 Apr 2007 05:48:21 +0000 (19 22:48 -0700)
treed038d97634b0705a1836095c0a53eb926a2f77ae
parent2de00bf9e8815970c61cefaef35efeacd8a7d6de
Fix working directory errno handling when unlinking a directory

Alex Riesen noticed that the case where a file replaced a directory entry
in the working tree was broken on cygwin. It turns out that the code made
some Linux-specific assumptions, and also ignored errors entirely for the
case where the entry was a symlink rather than a file.

This cleans it up by separating out the common case into a function of its
own, so that both regular files and symlinks can share it, and by making
the error handling more obvious (and not depend on any Linux-specific
behaviour).

Acked-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
merge-recursive.c