]> git.ipfire.org Git - thirdparty/git.git/commit
mingw: implement `stat()` with symlink support
authorKarsten Blees <karsten.blees@gmail.com>
Fri, 9 Jan 2026 20:04:59 +0000 (20:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 10 Jan 2026 02:32:54 +0000 (18:32 -0800)
commit48bc5094de4d2c549efd82780d4488071955d4ff
tree88375c0d7e186c025b29d490e47657dc738af2e9
parent3b96b99683679ee0d0c4e05cb5d1da37e13e02e5
mingw: implement `stat()` with symlink support

With respect to symlinks, the current `mingw_stat()` implementation is
almost identical to `mingw_lstat()`: except for the file type (`st_mode
& S_IFMT`), it returns information about the link rather than the target.

Implement `mingw_stat()` by opening the file handle requesting minimal
permissions, and then calling `GetFileInformationByHandle()` on it. This
way, all links are resolved by the Windows file system layer.

Signed-off-by: Karsten Blees <karsten.blees@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c