Skip to main content

git_dir

Function git_dir 

Source
pub fn git_dir(cwd: &Path) -> Result<PathBuf>
Expand description

Resolve the Git directory for the current working directory.

For the main worktree this returns .git; for a linked worktree it returns the worktree-specific Git directory (e.g. <main>/.git/worktrees/<name>).

ยงErrors

Returns an error if git rev-parse --git-dir fails.