Documentation
¶
Overview ¶
Package source resolves repository context and compare specifications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LocalDefaultBranch ¶ added in v0.3.9
LocalDefaultBranch returns the name of the local default branch, preferring "main" over "master". Returns an error if neither local branch exists.
func ResolveRepoContext ¶
ResolveRepoContext queries git rev-parse to build a RepoContext.
func WorktreeBaseRef ¶ added in v0.3.9
WorktreeBaseRef returns the BaseRef to use for dashboard drill-down diffs: the merge-base of HEAD and the local default branch, so a worktree's diff shows its own changes relative to local trunk rather than @{upstream}. Returns "" when no local default branch exists or merge-base fails, so the caller falls back to the default @{upstream} resolution.
Uses the fully qualified refs/heads/<branch> form for merge-base so a tag of the same name cannot be picked up instead of the local branch.
Types ¶
type BootstrapResult ¶
type BootstrapResult struct {
Repo model.RepoContext
Runner gitexec.GitRunner
}
BootstrapResult holds the resolved repo context and a repo-scoped runner.
type CompareResolver ¶
CompareResolver resolves a CompareRequest into a ResolvedCompare.
func (*CompareResolver) Resolve ¶
func (cr *CompareResolver) Resolve(ctx context.Context, req model.CompareRequest) (model.ResolvedCompare, error)
Resolve turns a CompareRequest into a fully-resolved ResolvedCompare.