fix mingw stat() and lstat() implementations for handling symlinks
commita01d212a07255abca1ed0fb3fb2b78df5be8bf03
authorPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 17 Mar 2010 15:17:34 +0000 (17 15:17 +0000)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 25 Aug 2010 10:28:29 +0000 (25 12:28 +0200)
treec1ea181647acad12223c7ce9c5d0267b878fe9e7
parent4c9190d5aadbc09efbf91518cbf068c00691d6cf
fix mingw stat() and lstat() implementations for handling symlinks

In msysGit the stat() function has been implemented using mingw_lstat
which sets the st_mode member to S_IFLNK when a symbolic links is found.
This causes the is_executable function to return when git attempts to
build a list of available commands in the help code and we end up missing
most git commands. (msysGit issue #445)

This patch modifies the implementation so that lstat() will return the link
flag but if we are called as stat() we read the size of the target and set
the mode to that of a regular file.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
compat/mingw.c
compat/mingw.h