In git worktree directories, `.git` is a configuration file rather than a subdirectory (cherry picked from commit 6a6d0906)