Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsReadOnlyGitCommand ¶
Types ¶
type CommandType ¶
type CommandType int
const ( UnknownCommand CommandType = iota Porcelain Plumbing Custom )
func (CommandType) String ¶
func (ct CommandType) String() string
type GitCommand ¶
type GitCommand struct { Name string // e.g. "branch" Args []string // flags and operands Valid bool // was Name in our lookup? Type CommandType // Porcelain, Plumbing, or Unknown IsReadOnly bool ValidationErr error // any parse / lookup error }
GitCommand represents a parsed "git …" invocation.
func ParseGitCommand ¶
func ParseGitCommand(raw string) *GitCommand
ParseGitCommand parses a git command string into a GitCommand struct.
type H ¶
type H struct {
// contains filtered or unexported fields
}
H is the struct for wrapping git helper functions It holds repoDir where commands are executed.
func NewGitHelper ¶
NewGitHelper creates a new GitHelper instance.
func (*H) GetCurrentGitRef ¶
GetCurrentGitRef returns the current ref (branch, tag, commit hash) in the repository.
func (*H) GetRepoGitDir ¶
GetRepoGitDir returns the path to the .git directory of current repository.
Click to show internal directories.
Click to hide internal directories.