Skip to main content

worktree_toplevel

Function worktree_toplevel 

Source
pub fn worktree_toplevel(from: &Path) -> String
Expand description

Return the canonicalized git worktree toplevel for from.

Runs git rev-parse --show-toplevel in from and canonicalizes the result so the value is comparable across the write side (the stream hook’s origin marker) and the read side (verify-start disambiguation) regardless of symlinked paths (e.g. /tmp → /private/tmp). Falls back to the canonicalized from when git is unavailable or from is not a repo.

§Panics

Never panics.