Status returns the status of the submodules.
()
| 317 | |
| 318 | // Status returns the status of the submodules. |
| 319 | func (s Submodules) Status() (SubmodulesStatus, error) { |
| 320 | var list SubmodulesStatus |
| 321 | |
| 322 | var r *Repository |
| 323 | for _, sub := range s { |
| 324 | if r == nil { |
| 325 | r = sub.w.r |
| 326 | } |
| 327 | |
| 328 | idx, err := r.Storer.Index() |
| 329 | if err != nil { |
| 330 | return nil, err |
| 331 | } |
| 332 | |
| 333 | status, err := sub.status(idx) |
| 334 | if err != nil { |
| 335 | return nil, err |
| 336 | } |
| 337 | |
| 338 | list = append(list, status) |
| 339 | } |
| 340 | |
| 341 | return list, nil |
| 342 | } |
| 343 | |
| 344 | // SubmodulesStatus contains the status for all submodiles in the worktree |
| 345 | type SubmodulesStatus []*SubmoduleStatus |