Documentation ¶
Index ¶
- Constants
- func Config(options ...types.Option) (string, error)
- func DetectGitDir() (string, error)
- func DiffIndex(options ...types.Option) (string, error)
- func DiffTree(options ...types.Option) (string, error)
- func ExtractBranchFromRefPath(head string) string
- func IsZeroHash(hash string) bool
- func Log(options ...types.Option) (string, error)
- func RevParse(options ...types.Option) (string, error)
- func SetDebug(debug bool) types.Option
- func SetExecutor(executor types.Executor) types.Option
- type Repo
- type Repository
- func (r *Repository) BranchName() string
- func (r *Repository) ChangedFiles(from, to string) ([]string, error)
- func (r *Repository) CommitMessage(path string) (*types.CommitMessage, error)
- func (r *Repository) CommitsBetween(from string, to string) []*types.Commit
- func (r *Repository) ConfigValue(value string, defaultValue string) string
- func (r *Repository) GitDir() string
- func (r *Repository) HookExists(hook string) bool
- func (r *Repository) HooksDir() string
- func (r *Repository) IsMerging() bool
- func (r *Repository) Path() string
- func (r *Repository) PrepareCommitMessage(path string, msg *types.CommitMessage) error
- func (r *Repository) StagedFiles() ([]string, error)
Constants ¶
View Source
const (
FilterDefault = "ACMR"
)
Variables ¶
This section is empty.
Functions ¶
func DetectGitDir ¶
func IsZeroHash ¶
IsZeroHash indicates if commit hash is a zero hash 0000000000000000000000000000000000000000
Types ¶
type Repo ¶
type Repo interface { // Path returns the path to the repositories root directory Path() string // GitDir returns the path to the .git directory of the repository GitDir() string // HookExists tells you if a hook script for a given hook exists HookExists(hook string) bool // HooksDir returns the path to the repositories hooks directory HooksDir() string // CommitMessage creates a CommitMessage type from a message file and returns it CommitMessage(path string) (*types.CommitMessage, error) // PrepareCommitMessage will write the commit message back to the file PrepareCommitMessage(path string, msg *types.CommitMessage) error // ConfigValue will return a git config value ConfigValue(value string, defaultValue string) string // IsMerging tells you if the repository is in a merging state IsMerging() bool // StagedFiles returns a list of staged files StagedFiles() ([]string, error) // ChangedFiles returns a list of changed files ChangedFiles(from, to string) ([]string, error) // BranchName returns the current branch name BranchName() string // CommitsBetween returns a list of Commit between two hashes CommitsBetween(from string, to string) []*types.Commit }
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(gitDir string) (*Repository, error)
func (*Repository) BranchName ¶
func (r *Repository) BranchName() string
func (*Repository) ChangedFiles ¶
func (r *Repository) ChangedFiles(from, to string) ([]string, error)
func (*Repository) CommitMessage ¶
func (r *Repository) CommitMessage(path string) (*types.CommitMessage, error)
func (*Repository) CommitsBetween ¶
func (r *Repository) CommitsBetween(from string, to string) []*types.Commit
func (*Repository) ConfigValue ¶
func (r *Repository) ConfigValue(value string, defaultValue string) string
func (*Repository) GitDir ¶
func (r *Repository) GitDir() string
func (*Repository) HookExists ¶
func (r *Repository) HookExists(hook string) bool
func (*Repository) HooksDir ¶
func (r *Repository) HooksDir() string
func (*Repository) IsMerging ¶
func (r *Repository) IsMerging() bool
func (*Repository) Path ¶
func (r *Repository) Path() string
func (*Repository) PrepareCommitMessage ¶
func (r *Repository) PrepareCommitMessage(path string, msg *types.CommitMessage) error
func (*Repository) StagedFiles ¶
func (r *Repository) StagedFiles() ([]string, error)
Click to show internal directories.
Click to hide internal directories.