Status returns the status of the submodules.
()
| 383 | |
| 384 | // Status returns the status of the submodules. |
| 385 | func (s Submodules) Status() (SubmodulesStatus, error) { |
| 386 | var list SubmodulesStatus |
| 387 | |
| 388 | var r *Repository |
| 389 | for _, sub := range s { |
| 390 | if r == nil { |
| 391 | r = sub.w.r |
| 392 | } |
| 393 | |
| 394 | idx, err := r.Storer.Index() |
| 395 | if err != nil { |
| 396 | return nil, err |
| 397 | } |
| 398 | |
| 399 | status, err := sub.status(idx) |
| 400 | if err != nil { |
| 401 | return nil, err |
| 402 | } |
| 403 | |
| 404 | list = append(list, status) |
| 405 | } |
| 406 | |
| 407 | return list, nil |
| 408 | } |
| 409 | |
| 410 | // SubmodulesStatus contains the status for all submodiles in the worktree |
| 411 | type SubmodulesStatus []*SubmoduleStatus |