File: commit_file.go

package info (click to toggle)
lazygit 0.50.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,808 kB
  • sloc: sh: 128; makefile: 76
file content (28 lines) | stat: -rw-r--r-- 524 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package models

// CommitFile : A git commit file
type CommitFile struct {
	Path 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.Path
}

func (f *CommitFile) Description() string {
	return f.Path
}

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.Path
}