Use worktree for HEAD even if not on a branch
Even when the repository is not currently on a branch (as is sometimes the case in CI), the HEAD branch pattern should resolve to the worktree. Currently, it fails to match a branch and thus gets ignored.