pub fn resolve_git_root(start: &Path) -> Option<PathBuf>Expand description
Resolve the git repository root, handling worktrees.
Walks up from start looking for .git:
- Directory → parent is the repo root (normal repo).
- File with
gitdir: .../worktrees/{name}→ strip to find the common.gitdirectory, then return its parent (the main working tree root). - File without
/worktrees/(e.g. submodule) → return that directory. - Not found → returns
None(non-git directory; caller uses original path).