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

Method Status

worktree_status.go:35–48  ·  view source on GitHub ↗

Status returns the working tree status.

()

Source from the content-addressed store, hash-verified

33
34// Status returns the working tree status.
35func (w *Worktree) Status() (Status, error) {
36 var hash plumbing.Hash
37
38 ref, err := w.r.Head()
39 if err != nil && err != plumbing.ErrReferenceNotFound {
40 return nil, err
41 }
42
43 if err == nil {
44 hash = ref.Hash()
45 }
46
47 return w.status(hash)
48}
49
50func (w *Worktree) status(commit plumbing.Hash) (Status, error) {
51 s := make(Status)

Callers 15

CleanMethod · 0.95
TestCheckoutBranchMethod · 0.95
TestCheckoutCreateMethod · 0.95
TestStatusMethod · 0.95
TestResetMethod · 0.95
TestResetSoftMethod · 0.95
TestResetMixedMethod · 0.95

Calls 3

statusMethod · 0.95
HeadMethod · 0.80
HashMethod · 0.65

Tested by 15

TestCheckoutBranchMethod · 0.76
TestCheckoutCreateMethod · 0.76
TestStatusMethod · 0.76
TestResetMethod · 0.76
TestResetSoftMethod · 0.76
TestResetMixedMethod · 0.76
TestStatusModifiedMethod · 0.76
TestStatusIgnoredMethod · 0.76