gitcli

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package gitcli is the RepoStore adapter that shells out to the git binary, keeping one bare clone per repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GHCredentialConfig

func GHCredentialConfig(host string) []string

GHCredentialConfig makes git authenticate to host through `gh auth`, replacing any other credential helper configured for it.

func HTTPSCloneURL

func HTTPSCloneURL(r domain.Repo) string

HTTPSCloneURL fetches over HTTPS, e.g. https://github.com/owner/repo.git.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store keeps bare clones under root, at <root>/<host>/<owner>/<repo>.git, and PR worktrees under worktrees, at <worktrees>/<host>/<owner>/<repo>/<pr>.

func New

func New(root, worktrees string, cloneURL func(domain.Repo) string, gitConfig ...string) *Store

New returns a Store keeping clones under root and worktrees under worktrees. cloneURL maps a repository to the URL it is fetched from, and each gitConfig entry ("key=value") is passed to every git invocation with -c.

func (*Store) Attribute

func (s *Store) Attribute(ctx context.Context, repo domain.Repo, sha domain.SHA, attr string, paths []string) (map[string]string, error)

func (*Store) Blob

func (s *Store) Blob(ctx context.Context, repo domain.Repo, sha domain.SHA, path string) ([]byte, error)

func (*Store) Changes

func (s *Store) Changes(ctx context.Context, repo domain.Repo, from, to domain.SHA) ([]domain.FileChange, error)

func (*Store) FetchPR

func (s *Store) FetchPR(ctx context.Context, pr domain.PRRef, baseBranch string, baseSHA domain.SHA) (domain.SHA, error)

func (*Store) FileDiff

func (s *Store) FileDiff(ctx context.Context, repo domain.Repo, from, to domain.SHA, change domain.FileChange) (domain.FileDiff, error)

func (*Store) HasCommit

func (s *Store) HasCommit(ctx context.Context, repo domain.Repo, sha domain.SHA) (bool, error)

func (*Store) ListFiles

func (s *Store) ListFiles(ctx context.Context, repo domain.Repo, sha domain.SHA) ([]string, error)

func (*Store) MergeBase

func (s *Store) MergeBase(ctx context.Context, repo domain.Repo, a, b domain.SHA) (domain.SHA, error)

func (*Store) RemoveWorktree

func (s *Store) RemoveWorktree(ctx context.Context, pr domain.PRRef) error

func (*Store) Worktree

func (s *Store) Worktree(ctx context.Context, pr domain.PRRef, sha domain.SHA) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL