Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckoutBranch ¶
func CheckoutBranch(r *git.Repository, branchName string, force bool) error
CheckoutBranch checks out the given branch name and waits for validation
Types ¶
type Branch ¶
type Branch struct {
Name string
IsCurrent bool
LastCommit time.Time
Hash string
Remote string
RemoteIdx int // For handling multiple remotes if needed, simplified here
}
func GetBranches ¶
func GetBranches(r *git.Repository) ([]Branch, error)
GetBranches returns a list of local branches sorted by recency
type Commit ¶
func GetRecentCommits ¶
GetRecentCommits returns the last n commits from the given branch (or HEAD if empty)
type FileStatus ¶
type RepoInfo ¶
type RepoInfo struct {
Path string
CurrentBranch string
IsClean bool
Remotes []string
Repo *git.Repository
}
func GetRepoInfo ¶
GetRepoInfo opens the repository and extracts basic information
func GetRepoInfoFromRepo ¶
func GetRepoInfoFromRepo(path string, r *git.Repository) (*RepoInfo, error)
type Repository ¶
type Repository = git.Repository
type StashEntry ¶
func GetStashList ¶
func GetStashList(r *git.Repository) ([]StashEntry, error)
GetStashList returns the list of stash entries. Note: go-git support for stash is limited, we might need to parse refs/stash.
type WorkingDirStatus ¶
type WorkingDirStatus struct {
Files []FileStatus
BranchName string
Modified int
Staged int
Untracked int
Conflicted int
}
func GetWorkingDirStatus ¶
func GetWorkingDirStatus(r *git.Repository) (*WorkingDirStatus, error)
GetWorkingDirStatus returns the status of files in the working directory
Click to show internal directories.
Click to hide internal directories.