Skip to main content

is_linked_worktree

Function is_linked_worktree 

Source
pub fn is_linked_worktree(cwd: &Path) -> Result<bool>
Expand description

Returns true when the current working directory is inside a linked (non-main) Git worktree.

Detection works by comparing the resolved --git-dir (worktree-specific) against --git-common-dir (shared). When they differ the worktree is a linked one.

ยงErrors

Returns an error if the underlying git rev-parse calls fail.