MCPcopy Create free account
hub / github.com/go-git/go-git / File

Method File

status.go:15–21  ·  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

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

Callers 15

mockBlameMethod · 0.45
BlameFunction · 0.45
addBlamesMethod · 0.45
parentsContainingPathFunction · 0.45
blobHashFunction · 0.45
TestResetSoftMethod · 0.45
TestResetMixedMethod · 0.45
TestStatusModifiedMethod · 0.45
TestStatusUntrackedMethod · 0.45
TestStatusDeletedMethod · 0.45
TestAddUntrackedMethod · 0.45

Calls

no outgoing calls

Tested by 15

mockBlameMethod · 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