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

Method StatusWithOptions

worktree_status.go:49–62  ·  view source on GitHub ↗

StatusWithOptions returns the working tree status.

(o StatusOptions)

Source from the content-addressed store, hash-verified

47
48// StatusWithOptions returns the working tree status.
49func (w *Worktree) StatusWithOptions(o StatusOptions) (Status, error) {
50 var hash plumbing.Hash
51
52 ref, err := w.r.Head()
53 if err != nil && err != plumbing.ErrReferenceNotFound {
54 return nil, err
55 }
56
57 if err == nil {
58 hash = ref.Hash()
59 }
60
61 return w.status(o.Strategy, hash)
62}
63
64func (w *Worktree) status(ss StatusStrategy, commit plumbing.Hash) (Status, error) {
65 s, err := ss.new(w)

Callers 3

TestStatusUnmodifiedMethod · 0.95
StatusMethod · 0.95

Calls 3

statusMethod · 0.95
HeadMethod · 0.80
HashMethod · 0.65