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

Method TestInit

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

Source from the content-addressed store, hash-verified

42}
43
44func (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
65func (s *SubmoduleSuite) TestUpdate(c *C) {
66 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