Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrVCSRepositoryNotExist = errors.New("vcs repository not found")
Functions ¶
This section is empty.
Types ¶
type NoVCsState ¶
type NoVCsState struct{}
NoVCsState implements the StateFetcher interface. All it's methods return VCSRepositoryNotExistErr.
func (*NoVCsState) CommitID ¶
func (*NoVCsState) CommitID() (string, error)
CommitID returns VCSRepositoryNotExistErr.
func (*NoVCsState) WorktreeIsDirty ¶
func (*NoVCsState) WorktreeIsDirty() (bool, error)
WorktreeIsDirty returns VCSRepositoryNotExistErr.
type StateFetcher ¶
StateFetcher is an interface for retrieving information about a VCS repository.
func GetState ¶
func GetState(dir string, logfunc Logfn) (StateFetcher, error)
GetState returns a git.RepositoryState() if the current directory is in a git repository and git command is in $PATH. If it's not, *NoVCsState is returned. The function caches the result for the last directory it was called. logfunc can be nil, to disable logging
Click to show internal directories.
Click to hide internal directories.