1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-14 11:23:09 +02:00
lazygit/pkg/commands/models/commit_file.go
2023-07-03 12:54:13 +10:00

30 lines
554 B
Go

package models
// CommitFile : A git commit file
type CommitFile struct {
// TODO: rename this to Path
Name string
ChangeStatus string // e.g. 'A' for added or 'M' for modified. This is based on the result from git diff --name-status
}
func (f *CommitFile) ID() string {
return f.Name
}
func (f *CommitFile) Description() string {
return f.Name
}
func (f *CommitFile) Added() bool {
return f.ChangeStatus == "A"
}
func (f *CommitFile) Deleted() bool {
return f.ChangeStatus == "D"
}
func (f *CommitFile) GetPath() string {
return f.Name
}