Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChangeStatus ¶
type ChangeStatus int
ChangeStatus represents the type of change to a file.
const ( StatusModified ChangeStatus = iota StatusAdded StatusDeleted StatusRenamed StatusUntracked StatusBinary )
type DeletedLine ¶
DeletedLine represents a line that was deleted from the old version.
type DiffInfo ¶
type DiffInfo struct {
ChangedLines map[int]bool // added/modified line numbers (1-based) in new file
DeletedAfter map[int][]DeletedLine // deleted lines keyed by the new-file line they appear after (0 = before line 1)
}
DiffInfo contains parsed diff information for a single file.
type FileChange ¶
type FileChange struct {
Path string
Status ChangeStatus
OldPath string // for renames
}
FileChange describes a single changed file.
func ChangedFiles ¶
func ChangedFiles(dir string) ([]FileChange, error)
ChangedFiles returns files with changes relative to HEAD (staged + unstaged + untracked).
func ChangedFilesFrom ¶
func ChangedFilesFrom(dir, ref string) ([]FileChange, error)
ChangedFilesFrom returns files changed relative to a ref (branch, commit, HEAD~N).
Click to show internal directories.
Click to hide internal directories.