Skip to main content

get_git_common_dir

Function get_git_common_dir 

Source
pub fn get_git_common_dir() -> Result<PathBuf>
Expand description

Get the absolute path to the git common directory.

In a linked worktree, get_git_dir returns the worktree-private administrative directory (.git/worktrees/<name>), but git reads info/exclude from the common directory shared by the main repository and all of its worktrees. Callers that need info/exclude must resolve it against this path rather than get_git_dir.