Documentation
¶
Overview ¶
Package gitdiff resolves the merge-base commit between HEAD and a base ref using go-git, then reads file content from that commit's tree. It has no GraphQL-specific knowledge; the graphql lint --diff subcommand combines its output with the working tree's own content to compute the violations that are new.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrShallowClone = errors.New("shallow clone: deepen it (e.g. `git fetch --unshallow`) before using --diff")
ErrShallowClone is returned by MergeBaseFiles when the repository is a shallow clone. A shallow clone's object store can be missing the merge-base commit, so --diff mode fails fast rather than risk an incomplete or wrong comparison. Deepen the clone (for example, `git fetch --unshallow origin <branch> <base>`) and retry.
Functions ¶
func MergeBaseFiles ¶
MergeBaseFiles opens the git repository containing dir, resolves the merge-base commit between HEAD and base, and reads each of files (paths relative to dir) from that commit's tree. The returned map is keyed by the same strings given in files; a file that did not yet exist at the merge-base is omitted rather than treated as an error, since it can't have had any violations at that point.
Types ¶
This section is empty.