Versions in this module Expand all Collapse all v0 v0.1.60 Oct 19, 2026 Changes in this version + var ErrNoFileView = errors.New("no web file view") + var ErrPathNotFound = errors.New("path not found at commit") type Cache + func (c *Cache) History(ctx context.Context, repo *Repository, ref string, options HistoryOptions) ([]Commit, error) + func (c *Cache) Show(ctx context.Context, repo *Repository, sha, path string) ([]byte, error) type Commit + Renames []Rename + Status map[string]FileStatus + type CommitState string + const CommitStateError + const CommitStateFailure + const CommitStatePending + const CommitStateSuccess + type CommitStatus struct + Context string + Description string + State CommitState + TargetURL string + type FileStatus string + const FileAdded + const FileCopied + const FileDeleted + const FileModified + const FileRenamed + const FileTypeChanged + type HistoryOptions struct + Follow bool + Limit int + Paths []string + Since string + type ListPullRequestsOptions struct + Base string + Head string + Limit int + State PullRequestState type Provider + CommentPullRequest func(ctx context.Context, repo RepoURL, number int, body string) (string, error) + ListPullRequestActivity func(ctx context.Context, repo RepoURL, number int) ([]PullRequestActivity, error) + ListPullRequests func(ctx context.Context, repo RepoURL, options ListPullRequestsOptions) ([]PullRequest, error) + SetCommitStatus func(ctx context.Context, repo RepoURL, sha string, status CommitStatus) error type PullRequest + Author string + Body string + CreatedAt time.Time + HeadRepository string + HeadSHA string + type PullRequestActivity struct + Author string + Body string + CreatedAt time.Time + Kind PullRequestActivityKind + URL string + type PullRequestActivityKind string + const PullRequestComment + const PullRequestHistory + type PullRequestPolicy struct + BuildID int + ID int + MinimumApproverCount int + Name string + Required bool + Status string + URL string + type PullRequestReview struct + Policies []PullRequestPolicy + Reviewers []PullRequestReviewer + type PullRequestReviewReader interface + PullRequestReview func(ctx context.Context, repo RepoURL, number int) (PullRequestReview, error) + type PullRequestReviewer struct + ID string + Name string + Required bool + Vote int + type Rename struct + From string + To string type RepoURL + func (u RepoURL) FileURL(ref Ref, path string) (string, error) + type VisiblePaths struct + func ListVisiblePaths(ctx context.Context, directory string) (VisiblePaths, error) + func (visible VisiblePaths) Contains(path string) bool + func (visible VisiblePaths) IsIgnored(ctx context.Context, path string) (bool, error) v0.1.59 Oct 18, 2026 Changes in this version + var ErrBaseMoved = errors.New("change base moved off the expected commit") + var ErrBranchExists = errors.New("branch already exists on the remote") + var ErrNoIdentity = errors.New("no git user.name/user.email configured") + var ErrNotRepository = errors.New("not a git repository") + var ErrPullRequestsUnsupported = errors.New("pull requests are not supported by this git provider") + var ErrTagExists = errors.New("tag already exists on the remote") + func Redact(text string) string + func ValidateBranchName(name string) error + func ValidateRevision(rev string) error + func ValidateTagName(name string) error + type APIError struct + Body string + Method string + Provider string + StatusCode int + URL string + func (e *APIError) Error() string + type Auth struct + Password string + PrivateKey string + TLS TLS + Token string + Username string + func (a Auth) Validate() error + type Cache struct + Root string + func (c *Cache) Apply(ctx context.Context, repo *Repository, request ChangeRequest) (ChangeResult, error) + func (c *Cache) Checkout(ctx context.Context, repo *Repository, options CheckoutOptions) (*Worktree, error) + func (c *Cache) Compare(ctx context.Context, repo *Repository, base, head string) (Comparison, error) + func (c *Cache) Log(ctx context.Context, repo *Repository, base, head string, options LogOptions) ([]Commit, error) + type ChangeRequest struct + AllowEmpty bool + Author Signature + Base string + BaseSHA string + Branch string + CherryPick []string + CherryPickMainline int + Files []FileChange + Message string + PullRequest *PullRequestRequest + Tag *TagOptions + Trailers []string + type ChangeResult struct + Branch string + CommitSHA string + PullRequest *PullRequest + SkippedCherryPicks []string + Tag string + type CheckoutOptions struct + Depth int + Ephemeral bool + Ref string + type CherryPickConflictError struct + Commit string + Files []string + func (e *CherryPickConflictError) Error() string + type CherryPickEmptyError struct + Base string + Commit string + func (e *CherryPickEmptyError) Error() string + type Client struct + Auth Auth + Provider Provider + Type string + func FromConnection(ctx dbcontext.Context, conn models.Connection) (*Client, error) + func (c *Client) Repository(rawURL string) (*Repository, error) + type CloneOptions struct + Depth int + Dir string + Ref string + type Commit struct + Author Signature + Body string + Date time.Time + Files []string + Parents []string + SHA string + ShortSHA string + Subject string + func (c Commit) IsMerge() bool + type CommitOptions struct + Author Signature + Message string + type Comparison struct + Ahead int + Behind int + MergeBase string + type DirtyStats struct + Conflicts int + Staged int + Unstaged int + Untracked int + func (s DirtyStats) Clean() bool + type FileChange struct + Content []byte + Delete bool + Path string + type InspectOptions struct + BranchHint string + RepositoryHint string + type LastCommit struct + Author string + CommittedAt time.Time + Subject string + type ListRepositoriesOptions struct + Namespace string + type LogOptions struct + Limit int + Paths []string + type Metadata struct + Branch string + Dirty DirtyStats + LastCommit LastCommit + Repository string + SHA string + func Inspect(ctx context.Context, dir string, options InspectOptions) (Metadata, error) + type Provider interface + ClosePullRequest func(ctx context.Context, repo RepoURL, number int) error + GetPullRequest func(ctx context.Context, repo RepoURL, number int) (PullRequest, error) + ListRepositories func(ctx context.Context, options ListRepositoriesOptions) ([]RepositoryInfo, error) + OpenPullRequest func(ctx context.Context, repo RepoURL, request PullRequestRequest) (PullRequest, error) + SupportsPullRequests func() bool + Type func() string + Verify func(ctx context.Context) error + type PullRequest struct + Base string + Head string + Number int + State PullRequestState + Title string + URL string + type PullRequestRequest struct + Assignees []string + AutoMerge bool + Base string + Body string + Draft bool + Head string + Labels []string + Reviewers []string + Title string + type PullRequestState string + const PullRequestClosed + const PullRequestMerged + const PullRequestOpen + type PushOptions struct + Branch string + ExpectedSHA string + Force bool + RemoteBranch string + ServerOptions []string + Tags []string + type Ref struct + Annotated bool + FullName string + Kind RefKind + Name string + SHA string + func Clone(ctx context.Context, repo *Repository, options CloneOptions) (Ref, error) + type RefKind string + const RefBranch + const RefHead + const RefSHA + const RefTag + type RemoteRefs struct + Branches []Ref + Head *Ref + Tags []Ref + func (r RemoteRefs) Resolve(name string) (Ref, error) + type RepoURL struct + Clone string + Depth *int + Host string + Name string + Owner string + Path string + Project string + Provider string + Ref string + Scheme string + User string + func ParseRepoURL(raw, providerHint string) (RepoURL, error) + func (u RepoURL) CacheKey() string + func (u RepoURL) FullName() string + func (u RepoURL) Redacted() string + func (u RepoURL) Short() string + type Repository struct + Auth Auth + Provider Provider + URL RepoURL + func NewRepository(options RepositoryOptions) (*Repository, error) + func (r *Repository) LsRemote(ctx context.Context) (RemoteRefs, error) + func (r *Repository) OpenPullRequest(ctx context.Context, request PullRequestRequest) (PullRequest, error) + func (r *Repository) Resolve(ctx context.Context, ref string) (Ref, error) + type RepositoryInfo struct + Archived bool + CloneURL string + DefaultBranch string + FullName string + Name string + Namespace string + Private bool + SSHURL string + WebURL string + type RepositoryOptions struct + Auth Auth + Provider Provider + ProviderType string + URL string + type Signature struct + Email string + Name string + func DefaultIdentity(ctx context.Context) (Signature, error) + type TLS struct + CA string + Cert string + InsecureSkipVerify bool + Key string + type TagOptions struct + Message string + Name string + Tagger Signature + type Worktree struct + Dir string + Ref Ref + func (w *Worktree) Commit(ctx context.Context, options CommitOptions) (string, error) + func (w *Worktree) CreateBranch(ctx context.Context, name string) error + func (w *Worktree) CreateTag(ctx context.Context, options TagOptions) error + func (w *Worktree) DeleteFile(path string) error + func (w *Worktree) Push(ctx context.Context, options PushOptions) error + func (w *Worktree) Release() error + func (w *Worktree) WriteFile(path string, content []byte) error