Documentation
¶
Overview ¶
Package git centralises awf's go-git repository access: opening a repository tolerantly (linked worktrees, submodules, a stray worktreeConfig extension) so every awf command that reads git shares one open path. It reads only; it never mutates a repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangedPaths ¶
ChangedPaths returns the sorted, unique repo-relative paths changed either in the staged index (staged) or between the two revisions of rangeSpec ("a..b"). staged takes precedence; with neither selector the caller should not call this. A malformed range or an unresolvable revision is a clear error. It reads the repository only.
func OpenRepo ¶
func OpenRepo(repoRoot string) (*gogit.Repository, error)
OpenRepo opens the repo at repoRoot like git.PlainOpen, but hides its [extensions] config section from go-git's own extension-support check (repository_extensions.go verifyExtensions). That check has an upstream bug: it lowercases the incoming extension name ("worktreeconfig") before comparing it against its allow-list, whose key is mixed-case ("worktreeConfig") — the lookup never matches, so PlainOpen rejects any repo with `extensions.worktreeConfig` set (a flag `git worktree add` can leave behind even after the worktree is removed) regardless of repositoryformatversion. awf's git-reading commands never read repo extensions, so hiding the section is safe.
Unlike git.PlainOpen with default options, this also resolves a `.git` *file* — the `gitdir:` pointer `git worktree add` leaves at a linked worktree's root (and the submodule layout) — mirroring what PlainOpenWithOptions' EnableDotGitCommonDir does, so awf's git-reading commands work from a linked worktree. The manual storage construction (over PlainOpenWithOptions) exists solely so the storer wrapper above can be injected.
Types ¶
This section is empty.