Documentation
¶
Overview ¶
Package gitrepo locates a worktree and reads its branch without running git.
The status line renders once a second in every open session, so the hot path reads two small files instead of paying for a subprocess.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultBranch ¶
DefaultBranch resolves what this repo calls its trunk, so master and trunk repos are not silently compared against a main that does not exist.
Types ¶
type Repo ¶
func Locate ¶
Locate walks up from dir looking for .git, honouring the gitdir: pointer file that a linked worktree uses in place of a directory.
func (Repo) Key ¶
Key turns a worktree path into a filename safe on every platform.
Replacing only the path separator is not enough: on Windows that leaves the drive colon in place, and `< > : " / \ | ? *` are all illegal in a filename, so the cache file could never be created. Anything outside the safe set is folded to an underscore, and an FNV suffix keeps two paths that sanitise alike from sharing one cache entry.