Documentation
¶
Overview ¶
Package gitcli is the RepoStore adapter that shells out to the git binary, keeping one bare clone per repository.
Index ¶
- func GHCredentialConfig(host string) []string
- func HTTPSCloneURL(r domain.Repo) string
- type Store
- func (s *Store) Attribute(ctx context.Context, repo domain.Repo, sha domain.SHA, attr string, ...) (map[string]string, error)
- func (s *Store) Blob(ctx context.Context, repo domain.Repo, sha domain.SHA, path string) ([]byte, error)
- func (s *Store) Changes(ctx context.Context, repo domain.Repo, from, to domain.SHA) ([]domain.FileChange, error)
- func (s *Store) FetchPR(ctx context.Context, pr domain.PRRef, baseBranch string, baseSHA domain.SHA) (domain.SHA, error)
- func (s *Store) FileDiff(ctx context.Context, repo domain.Repo, from, to domain.SHA, ...) (domain.FileDiff, error)
- func (s *Store) HasCommit(ctx context.Context, repo domain.Repo, sha domain.SHA) (bool, error)
- func (s *Store) ListFiles(ctx context.Context, repo domain.Repo, sha domain.SHA) ([]string, error)
- func (s *Store) MergeBase(ctx context.Context, repo domain.Repo, a, b domain.SHA) (domain.SHA, error)
- func (s *Store) RemoveWorktree(ctx context.Context, pr domain.PRRef) error
- func (s *Store) Worktree(ctx context.Context, pr domain.PRRef, sha domain.SHA) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GHCredentialConfig ¶
GHCredentialConfig makes git authenticate to host through `gh auth`, replacing any other credential helper configured for it.
func HTTPSCloneURL ¶
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 ¶
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.