]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/fsmonitor--daemon.c
fsmonitor--daemon: cd out of worktree root
authorJeff Hostetler <jeffhost@microsoft.com>
Thu, 26 May 2022 21:47:07 +0000 (21:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 May 2022 22:59:26 +0000 (15:59 -0700)
commit39664e93093bd9545ad4085523b122196c449508
treeabb30251e7a09aaaa74818a0b5980aeb260bbb99
parent8e8f4b814bab3f1499e50404e344f5b483c91f40
fsmonitor--daemon: cd out of worktree root

Teach the fsmonitor--daemon to CD outside of the worktree
before starting up.

The common Git startup mechanism causes the CWD of the daemon process
to be in the root of the worktree.  On Windows, this causes the daemon
process to hold a locked handle on the CWD and prevents other
processes from moving or deleting the worktree while the daemon is
running.

CD to HOME before entering main event loops.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsmonitor--daemon.c
compat/fsmonitor/fsm-listen-win32.c
fsmonitor--daemon.h