| 42 | } |
| 43 | |
| 44 | func (s *SubmoduleSuite) TestInit(c *C) { |
| 45 | sm, err := s.Worktree.Submodule("basic") |
| 46 | c.Assert(err, IsNil) |
| 47 | |
| 48 | c.Assert(sm.initialized, Equals, false) |
| 49 | err = sm.Init() |
| 50 | c.Assert(err, IsNil) |
| 51 | |
| 52 | c.Assert(sm.initialized, Equals, true) |
| 53 | |
| 54 | cfg, err := s.Repository.Config() |
| 55 | c.Assert(err, IsNil) |
| 56 | |
| 57 | c.Assert(cfg.Submodules, HasLen, 1) |
| 58 | c.Assert(cfg.Submodules["basic"], NotNil) |
| 59 | |
| 60 | status, err := sm.Status() |
| 61 | c.Assert(err, IsNil) |
| 62 | c.Assert(status.IsClean(), Equals, false) |
| 63 | } |
| 64 | |
| 65 | func (s *SubmoduleSuite) TestUpdate(c *C) { |
| 66 | if testing.Short() { |