Documentation
¶
Index ¶
- Variables
- type GitRepo
- func (gr *GitRepo) Add(filename string) error
- func (gr *GitRepo) CacheFileNames()
- func (gr *GitRepo) CacheFilesChanged()
- func (gr *GitRepo) CommitFile(filename string, message string) error
- func (gr *GitRepo) InRepo(filename string) bool
- func (gr *GitRepo) IsChanged(filename string) bool
- func (gr *GitRepo) Move(oldpath, newpath string) error
- func (gr *GitRepo) Remove(filename string) error
- func (gr *GitRepo) RemoveKeepLocal(filename string) error
- func (gr *GitRepo) RevertFile(filename string) error
- type Repo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnknownVCS is returned when VCS cannot be determined from the vcs Repo ErrUnknownVCS = errors.New("Unknown VCS") )
Functions ¶
This section is empty.
Types ¶
type GitRepo ¶
func (*GitRepo) CacheFileNames ¶
func (gr *GitRepo) CacheFileNames()
func (*GitRepo) CacheFilesChanged ¶
func (gr *GitRepo) CacheFilesChanged()
func (*GitRepo) CommitFile ¶
CommitFile commits single file to repo staging
func (*GitRepo) RemoveKeepLocal ¶
Remove removes the file from the repo
func (*GitRepo) RevertFile ¶
RevertFile reverts a single file to last commit of master
type Repo ¶
type Repo interface {
// vcs.Repo includes those interface functions
vcs.Repo
// CacheFileNames reads all of the file names stored in the repository
// into a local cache to speed checking whether a file is in the repository or not.
CacheFileNames()
// CacheFilesChanged gets a list of files in repository changed since last commit
CacheFilesChanged()
// InRepo returns true if filename is in the repository -- uses CacheFileNames --
// will do that automatically but if cache might be stale, call it to refresh
InRepo(filename string) bool
// IsChanged checks against the cached list to see if the file is modified since the last commit
// IsDirty() will check with the repo rather than the cached list
IsChanged(filename string) bool
// Add adds the file to the repo
Add(filename string) error
// Move moves updates the repo with the rename
Move(oldpath, newpath string) error
// Remove removes the file from the repo
Remove(filename string) error
// RemoveKeepLocal removes the file from the repo but keeps the file itself
RemoveKeepLocal(filename string) error
// CommitFile commits a single file
CommitFile(filename string, message string) error
// RevertFile reverts a single file
RevertFile(filename string) error
}
Repo provides an interface that parallels vcs.Repo (https://github.com/Masterminds/vcs) with some additional functions
Click to show internal directories.
Click to hide internal directories.