Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCommitNotFound indicates a commit was not found in git output. ErrCommitNotFound = errors.New("commit not found") // ErrUnexpectedGitLogFormat indicates the git log output is not parseable. ErrUnexpectedGitLogFormat = errors.New("unexpected git log format") )
Functions ¶
Types ¶
type CommitReader ¶
type CommitReader struct {
// contains filtered or unexported fields
}
CommitReader reads commit data using the native git CLI.
func NewCommitReader ¶
func NewCommitReader(repoPath string) *CommitReader
NewCommitReader creates a CLI-backed commit reader.
func (CommitReader) GetCommitRange ¶
func (r CommitReader) GetCommitRange(ctx context.Context, fromRef, toRef string) ([]domain.Commit, error)
GetCommitRange retrieves commits in a range.
func (CommitReader) GetHeadCommits ¶
GetHeadCommits retrieves the latest commits from HEAD.
type Repository ¶ added in v0.9.4
type Repository struct {
CommitReader
}
Repository provides a git CLI-backed repository adapter.
func NewRepository ¶ added in v0.9.4
func NewRepository(repoPath string) *Repository
NewRepository creates a CLI-backed repository adapter.
func (Repository) BranchExists ¶ added in v0.9.4
func (r Repository) BranchExists(ctx context.Context, branchName string) bool
BranchExists checks if a branch reference exists locally or remotely.
func (Repository) GetCommitsAheadCount ¶ added in v0.9.4
GetCommitsAheadCount returns how many commits HEAD is ahead of the reference.
func (Repository) GetCurrentBranch ¶ added in v0.9.4
func (r Repository) GetCurrentBranch(ctx context.Context) (string, error)
GetCurrentBranch returns the current branch name.
Click to show internal directories.
Click to hide internal directories.