Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeType ¶
type ChangeType string
ChangeType represents the type of change for a diff line.
const ( ChangeAdd ChangeType = "+" ChangeRemove ChangeType = "-" ChangeContext ChangeType = " " ChangeDivider ChangeType = "~" // separates non-adjacent hunks )
type DiffLine ¶
type DiffLine struct {
OldNum int // line number in old version (0 for additions)
NewNum int // line number in new version (0 for removals)
Content string // line content without the +/- prefix
ChangeType ChangeType // changeAdd, ChangeRemove, ChangeContext, or ChangeDivider
}
DiffLine holds parsed line info from a diff.
func ParseUnifiedDiff ¶
ParseUnifiedDiff parses unified diff output into a slice of DiffLine entries. It handles the diff header, hunk headers, and content lines.
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
Git provides methods to extract changed files and build full-file diff views.
func (*Git) ChangedFiles ¶
ChangedFiles returns a list of files changed relative to the given ref. If ref is empty, it shows uncommitted changes. If staged is true, shows only staged changes.
Click to show internal directories.
Click to hide internal directories.