fix mingw stat() and lstat() implementations for handling symlinks
commit8342c09428289e56702b04a91362132517c89224
authorPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 17 Mar 2010 15:17:34 +0000 (17 15:17 +0000)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 11 Jun 2010 14:18:40 +0000 (11 16:18 +0200)
tree14028569d8e583f906a390a4ebae5493ffa2fcf3
parent160204121d4beabeede436491c5d9ab80f5b4778
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