Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocalRepo ¶
func GetLocalRepo() (*git.Repository, error)
func GetRepoConfig ¶
func OpenWorktreeAwareRepo ¶ added in v1.191.0
OpenWorktreeAwareRepo opens a Git repository at the given path, handling both regular repositories and worktrees correctly. It uses EnableDotGitCommonDir to properly support worktrees with access to the main repository's config, remotes, and references.
Types ¶
type DefaultGitRepo ¶ added in v1.192.0
type DefaultGitRepo struct{}
DefaultGitRepo is the default implementation of GitRepoInterface.
func (*DefaultGitRepo) GetCurrentCommitSHA ¶ added in v1.192.0
func (d *DefaultGitRepo) GetCurrentCommitSHA() (string, error)
GetCurrentCommitSHA returns the SHA of the current HEAD commit.
func (*DefaultGitRepo) GetLocalRepoInfo ¶ added in v1.192.0
func (d *DefaultGitRepo) GetLocalRepoInfo() (*RepoInfo, error)
GetLocalRepoInfo returns information about the local git repository.
func (*DefaultGitRepo) GetRepoInfo ¶ added in v1.192.0
func (d *DefaultGitRepo) GetRepoInfo(repo *git.Repository) (RepoInfo, error)
GetRepoInfo returns the repository information for the given git.Repository.
type GitRepoInterface ¶ added in v1.192.0
type GitRepoInterface interface {
GetLocalRepoInfo() (*RepoInfo, error)
GetRepoInfo(repo *git.Repository) (RepoInfo, error)
GetCurrentCommitSHA() (string, error)
}
GitRepoInterface defines the interface for git repository operations.
func NewDefaultGitRepo ¶ added in v1.192.0
func NewDefaultGitRepo() GitRepoInterface
NewDefaultGitRepo creates a new instance of DefaultGitRepo.