Status returns the working tree status.
()
| 33 | |
| 34 | // Status returns the working tree status. |
| 35 | func (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 | |
| 50 | func (w *Worktree) status(commit plumbing.Hash) (Status, error) { |
| 51 | s := make(Status) |