SIGN IN SIGN UP

worktree: Fix race condition when a root of worktree is .git directory (#12995)

It was possible to unload a root of worktree when it was a .git
directory; due to that, test_fs_events_in_dot_git_worktree was sometimes
stuck in an infinite loop on CI.

The gist of an issue is that when .git dir is a root dir, then modifying
a file within this directory could sometimes unload the .git dir; the
test went into an infinite loop when the first event in an filesystem
stream was not the event for the file creation, but for a dir
modification. In that case we'd unload the root directory and a
subsequent event for file creation would never be registered, leading to
the test being stuck waiting for it to happen.

This commit alleviates it by special-casing worktrees rooted in .git
directories.



Release Notes:

- Fixed a possible hang when opening a worktree in .git directory.
P
Piotr Osiewicz committed
14bf07c91626d8e821577923d1eeeac57711e769
Parent: 2845597
Committed by GitHub <noreply@github.com> on 6/13/2024, 5:24:41 PM