Init initialize the submodule reading the recorded Entry in the index for the given submodule
()
| 40 | // Init initialize the submodule reading the recorded Entry in the index for |
| 41 | // the given submodule |
| 42 | func (s *Submodule) Init() error { |
| 43 | cfg, err := s.w.r.Config() |
| 44 | if err != nil { |
| 45 | return err |
| 46 | } |
| 47 | |
| 48 | _, ok := cfg.Submodules[s.c.Name] |
| 49 | if ok { |
| 50 | return ErrSubmoduleAlreadyInitialized |
| 51 | } |
| 52 | |
| 53 | s.initialized = true |
| 54 | |
| 55 | cfg.Submodules[s.c.Name] = s.c |
| 56 | return s.w.r.Storer.SetConfig(cfg) |
| 57 | } |
| 58 | |
| 59 | // Status returns the status of the submodule. |
| 60 | func (s *Submodule) Status() (*SubmoduleStatus, error) { |