Skip to main content

git_path

Function git_path 

Source
pub fn git_path(layout: &RepoLayout, name: &str) -> Option<PathBuf>
Expand description

What: The absolute path git rev-parse --path-format=absolute --git-path <name> prints for the names this reader knows in a repository whose worktree owns its Git directory. Why: A linked worktree splits names between its own directory and the common one by a table in Git; those answers stay with Git.

In TS you’d write (pseudocode):

const gitPath = (layout, name) => layout.gitDir === layout.commonDir && KNOWN.has(name) ? join(layout.gitDir, name) : undefined;