Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DefaultInit ¶
func GetBranch ¶
GetBranch returns the branch of the repository only return the branch when the path is the root of the repository
func GetShortGitStatus ¶
GetShortGitStatus read the git status of the repository located at the path
Types ¶
type FileGit ¶
FileGit is an entry name with git status the name will not end with file separator
func (*FileGit) Set ¶
Set sets the status of the file based on the XY string X Y Meaning -------------------------------------------------
[AMD] not updated
M [ MTD] updated in index T [ MTD] type changed in index A [ MTD] added to index D deleted from index R [ MTD] renamed in index C [ MTD] copied in index [MTARC] index and work tree matches [ MTARC] M work tree changed since index [ MTARC] T type changed in work tree since index [ MTARC] D deleted in work tree
// R renamed in work tree // C copied in work tree
------------------------------------------------- D D unmerged, both deleted A U unmerged, added by us U D unmerged, deleted by them U A unmerged, added by them D U unmerged, deleted by us A A unmerged, both added U U unmerged, both modified ------------------------------------------------- ? ? untracked ! ! ignored -------------------------------------------------
type FileGits ¶
type FileGits = []FileGit
func ParseShort ¶
ParseShort parses a git status output command It is compatible with the short version of the git status command modified from https://le-gall.bzh/post/go/parsing-git-status-with-go/ author: Sébastien Le Gall
type RepoPath ¶
type RepoPath = string
func GetTopLevel ¶
GetTopLevel returns the top level of the repoPath the returned path is cleaned by pathbeautify.CleanSeparator
type RepoStatus ¶
type RepoStatus uint8
const ( RepoStatusSkip RepoStatus = iota RepoStatusClean RepoStatusDirty )
func GetRepoStatus ¶
func GetRepoStatus(repoPath RepoPath) RepoStatus
GetRepoStatus returns the status of the repository only return the status when the path is the root of the repository
func (RepoStatus) String ¶
func (r RepoStatus) String() string