Documentation ¶
Overview ¶
Package git operates git command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitFile ¶
type CommitFile struct { Status CommitStatus Path string }
CommitFile is a tuple composed of commit status and file path.
type CommitStatus ¶
type CommitStatus int
CommitStatus represent the status of changed files.
const ( Added CommitStatus = iota Copied Deleted Modified Renamed TypeChanged Unmerged Unknown )
Constants represent the commit status as an enumerated type.
type Git ¶
type Git struct { // Dir is the root directory of a Git repository. Dir string // Commit is the hash of a commit to operate on. If empty, it operates on the working tree. Commit string }
Git is a thin wrapper of git command line tool allowing to access files in Git history.
func New ¶
New creates a Git object operating on a commit identified by commit. If commit is empty, it operates on the working tree.
func (*Git) ChangedFiles ¶
func (g *Git) ChangedFiles() ([]CommitFile, error)
ChangedFiles returns the list of pairs of commit statuses and file paths changed in the commit.
Click to show internal directories.
Click to hide internal directories.