Documentation
¶
Overview ¶
Package gitroot derives a directory's enclosing git repository root via the external git binary. Missing repo, missing dir, and missing git binary all return ok=false with no error distinction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RepoRoot ¶
RepoRoot returns the cleaned, symlink-resolved absolute path of the git repository containing dir. Canonicalisation matches CLI path hand-off so gitstate keys and registry roots agree on macOS (/var vs /private/var) and other symlink-spelled temp roots. ok is false — never an error — when dir is outside any repo, does not exist, or git is not on PATH.
func RepoRootForNew ¶
RepoRootForNew derives the git root a not-yet-created dir would belong to by walking up to the nearest existing ancestor. Same uniform (root, ok) contract as RepoRoot.
Types ¶
This section is empty.