1
0
mirror of https://github.com/git/git.git synced 2024-10-20 14:39:10 +02:00
git/compat
Johannes Schindelin e2724c1ed1 getcwd(mingw): handle the case when there is no cwd
A recent upstream topic introduced checks for certain Git commands that
prevent them from deleting the current working directory, introducing
also a regression test that ensures that commands such as `git version`
_can_ run without a current working directory.

While technically not possible on Windows via the regular Win32 API, we
do run the regression tests in an MSYS2 Bash which uses a POSIX
emulation layer (the MSYS2/Cygwin runtime) where a really evil hack
_does_ allow to delete a directory even if it is the current working
directory.

Therefore, Git needs to be prepared for a missing working directory,
even on Windows.

This issue was not noticed in upstream Git because there was no caller
that tried to discover a Git directory with a deleted current working
directory in the test suite. But in the microsoft/git fork, we do want
to run `pre-command`/`post-command` hooks for every command, even for
`git version`, which means that we make precisely such a call. The bug
is not in that `pre-command`/`post-command` feature, though, but in
`mingw_getcwd()` and needs to be addressed there.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-19 11:27:31 -08:00
..
linux
nedmalloc
poll
regex
simple-ipc simple-ipc: work around issues with Cygwin's Unix socket emulation 2021-11-10 09:12:19 -08:00
stub
vcbuild
win32 lazyload: use correct calling conventions 2022-01-09 10:34:53 -08:00
.gitattributes
access.c
apple-common-crypto.h
basename.c
bswap.h
compiler.h
fileno.c
fopen.c
hstrerror.c
inet_ntop.c
inet_pton.c
memmem.c
mingw.c getcwd(mingw): handle the case when there is no cwd 2022-01-19 11:27:31 -08:00
mingw.h
mkdir.c
mkdtemp.c
mmap.c
msvc.c
msvc.h
obstack.c
obstack.h
open.c
pread.c
precompose_utf8.c
precompose_utf8.h
qsort_s.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
terminal.h
unsetenv.c unsetenv(3) returns int, not void 2021-10-29 15:00:58 -07:00
win32.h
win32mmap.c
winansi.c lazyload: use correct calling conventions 2022-01-09 10:34:53 -08:00
zlib-uncompress2.c