MCPcopy Create free account
hub / github.com/go-git/go-git / TestInit

Method TestInit

submodule_test.go:46–65  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

SubmoduleMethod · 0.80
InitMethod · 0.65
ConfigMethod · 0.65
StatusMethod · 0.45
IsCleanMethod · 0.45

Tested by

no test coverage detected