MCPcopy
hub / github.com/go-git/go-git / File

Method File

status.go:18–24  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
18func (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'
27func (s Status) IsUntracked(path string) bool {

Callers 15

mockBlameMethod · 0.45
preloadStatusFunction · 0.45
BlameFunction · 0.45
addBlamesMethod · 0.45
parentsContainingPathFunction · 0.45
blobHashFunction · 0.45
TestStatusUnmodifiedMethod · 0.45
TestResetSoftMethod · 0.45
TestResetMixedMethod · 0.45
TestStatusModifiedMethod · 0.45
TestStatusUntrackedMethod · 0.45

Calls

no outgoing calls

Tested by 15

mockBlameMethod · 0.36
TestStatusUnmodifiedMethod · 0.36
TestResetSoftMethod · 0.36
TestResetMixedMethod · 0.36
TestStatusModifiedMethod · 0.36
TestStatusUntrackedMethod · 0.36
TestStatusDeletedMethod · 0.36
TestAddUntrackedMethod · 0.36
TestIgnoredMethod · 0.36
TestAddModifiedMethod · 0.36
TestAddRemovedMethod · 0.36