File returns the FileStatus for a given path, if the FileStatus doesn't exists a new FileStatus is added to the map using the path as key.
(path string)
| 16 | // File returns the FileStatus for a given path, if the FileStatus doesn't |
| 17 | // exists a new FileStatus is added to the map using the path as key. |
| 18 | func (s Status) File(path string) *FileStatus { |
| 19 | if _, ok := (s)[path]; !ok { |
| 20 | s[path] = &FileStatus{Worktree: Untracked, Staging: Untracked} |
| 21 | } |
| 22 | |
| 23 | return s[path] |
| 24 | } |
| 25 | |
| 26 | // IsUntracked checks if file for given path is 'Untracked' |
| 27 | func (s Status) IsUntracked(path string) bool { |
no outgoing calls