git/compat
Johannes Schindelin f0af8b4aae mingw: do resolve symlinks in `getcwd()`
As pointed out in https://github.com/git-for-windows/git/issues/1676,
the `git rev-parse --is-inside-work-tree` command currently fails when
the current directory's path contains symbolic links.

The underlying reason for this bug is that `getcwd()` is supposed to
resolve symbolic links, but our `mingw_getcwd()` implementation did not.

We do have all the building blocks for that, though: the
`GetFinalPathByHandleW()` function will resolve symbolic links. However,
we only called that function if `GetLongPathNameW()` failed, for
historical reasons: the latter function was supported for a long time,
but the former API function was introduced only with Windows Vista, and
we used to support also Windows XP. With that support having been
dropped, we are free to call the symbolic link-resolving function right
away.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-01-09 18:28:35 -08:00
..
fsmonitor global: trivial conversions to fix `-Wsign-compare` warnings 2024-12-06 20:20:04 +09:00
linux
nedmalloc compat: disable -Wunused-parameter in 3rd-party code 2024-08-28 09:51:18 -07:00
poll global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
regex compat/regex: explicitly mark intentional use of the comma operator 2025-03-28 17:38:11 -07:00
simple-ipc Merge branch 'ak/typofixes' 2024-10-25 14:02:04 -04:00
stub compat: mark unused parameters in win32/mingw functions 2024-08-28 09:51:18 -07:00
vcbuild mingw.c: Fix complier warnings for a 64 bit msvc 2024-10-17 14:42:27 -04:00
win32 Merge branch 'gf/win32-pthread-cond-init' 2025-12-16 11:08:34 +09:00
.gitattributes
access.c
apple-common-crypto.h
basename.c
bswap.h bswap.h: provide a built-in based version of bswap32/64 if possible 2025-07-15 14:36:51 -07:00
compiler.h mingw.c: Fix complier warnings for a 64 bit msvc 2024-10-17 14:42:27 -04:00
disk.h
fileno.c
fopen.c
hstrerror.c
inet_ntop.c
inet_pton.c
memmem.c
mingw-posix.h compat: remove mingw_mktemp() 2025-12-07 07:28:12 +09:00
mingw.c mingw: do resolve symlinks in `getcwd()` 2026-01-09 18:28:35 -08:00
mingw.h compat/mingw: split out POSIX-related bits 2025-02-18 10:55:39 -08:00
mkdir.c
mmap.c compat/mmap: mark unused argument in git_munmap() 2025-11-18 09:36:05 -08:00
msvc-posix.h compat/mingw: split out POSIX-related bits 2025-02-18 10:55:39 -08:00
msvc.c
msvc.h compat/mingw: split out POSIX-related bits 2025-02-18 10:55:39 -08:00
nonblock.c
nonblock.h
obstack.c
obstack.h
open.c object-file: move `git_open_cloexec()` to "compat/open.c" 2025-04-15 08:24:35 -07:00
posix.h compat: remove gitmkdtemp() 2025-12-07 07:28:13 +09:00
pread.c
precompose_utf8.c config: drop `git_config_set()` wrapper 2025-07-23 08:15:21 -07:00
precompose_utf8.h
qsort_s.c
regcomp_enhanced.c
setenv.c
sha1-chunked.c
sha1-chunked.h
snprintf.c
stat.c
strcasestr.c
strdup.c
strlcpy.c
strtoimax.c
strtoumax.c
terminal.c global: trivial conversions to fix `-Wsign-compare` warnings 2024-12-06 20:20:04 +09:00
terminal.h
unsetenv.c
win32.h
win32mmap.c global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
winansi.c global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
zlib-compat.h git-zlib: use `struct z_stream_s` instead of typedef 2025-04-07 14:53:11 -07:00