Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangedFile ¶
type ChangedFile struct {
Path string
Status FileStatus
Diff string // unified diff format
Binary bool // true if binary file detected
}
ChangedFile represents a file changed in the working tree vs HEAD.
type FileStatus ¶
type FileStatus int
FileStatus represents the type of change to a file.
const ( StatusAdded FileStatus = iota StatusModified StatusDeleted )
func (FileStatus) String ¶
func (s FileStatus) String() string
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
Repo provides read-only access to a git repository.
func (*Repo) ChangedFiles ¶
func (r *Repo) ChangedFiles() ([]ChangedFile, error)
ChangedFiles returns files changed in the working tree compared to HEAD. It is safe for concurrent use. If go-git's status fails (e.g. due to permission errors on directories), it falls back to system git.
func (*Repo) HeadChanged ¶
HeadChanged checks if HEAD has changed since the last call. Returns whether it changed and the new commit message.
Click to show internal directories.
Click to hide internal directories.