pub fn detect_checkout(dir: &Path) -> CheckoutExpand description
Locate the checkout containing dir by walking up to the nearest .git.
A .git directory marks the primary checkout. A .git file whose
gitdir: points into <common>/worktrees/<name> marks a linked worktree,
whose primary checkout is the parent of the common directory. When no
.git is found the directory is treated as its own primary checkout, so
projects that are not git repositories still get a hostname.