]> git.ipfire.org Git - thirdparty/git.git/commit
mingw_open_existing: handle directories better
authorMatthias Aßhauer <mha1993@live.de>
Sun, 3 Aug 2025 21:25:15 +0000 (21:25 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Aug 2025 01:30:38 +0000 (18:30 -0700)
commit5f277fc5f25dc0fb54aa42bad62c23325bab9200
tree3e834ad6b959900292b290c12fdf326f4ca45911
parent866e6a391f466baeeb98bc585845ea638322c04b
mingw_open_existing: handle directories better

CreateFileW() requires FILE_FLAG_BACKUP_SEMANTICS to create a directory
handle [1] and errors out with ERROR_ACCESS_DENIED without this flag.
Fall back to accessing Directory handles this way.

[1] https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew#directories

This fixes https://github.com/git-for-windows/git/issues/5068

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c