StatusWithOptions returns the working tree status.
(o StatusOptions)
| 47 | |
| 48 | // StatusWithOptions returns the working tree status. |
| 49 | func (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 | |
| 64 | func (w *Worktree) status(ss StatusStrategy, commit plumbing.Hash) (Status, error) { |
| 65 | s, err := ss.new(w) |