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

Method TestUpdate

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

Source from the content-addressed store, hash-verified

65}
66
67func (s *SubmoduleSuite) TestUpdate(c *C) {
68 if testing.Short() {
69 c.Skip("skipping test in short mode.")
70 }
71
72 sm, err := s.Worktree.Submodule("basic")
73 c.Assert(err, IsNil)
74
75 err = sm.Update(&SubmoduleUpdateOptions{
76 Init: true,
77 })
78
79 c.Assert(err, IsNil)
80
81 r, err := sm.Repository()
82 c.Assert(err, IsNil)
83
84 ref, err := r.Reference(plumbing.HEAD, true)
85 c.Assert(err, IsNil)
86 c.Assert(ref.Hash().String(), Equals, "6ecf0ef2c2dffb796033e5a02219af86ec6584e5")
87
88 status, err := sm.Status()
89 c.Assert(err, IsNil)
90 c.Assert(status.IsClean(), Equals, true)
91}
92
93func (s *SubmoduleSuite) TestRepositoryWithoutInit(c *C) {
94 sm, err := s.Worktree.Submodule("basic")

Callers

nothing calls this directly

Calls 10

ShortMethod · 0.80
SubmoduleMethod · 0.80
RepositoryMethod · 0.80
SkipMethod · 0.65
ReferenceMethod · 0.65
StringMethod · 0.65
HashMethod · 0.65
UpdateMethod · 0.45
StatusMethod · 0.45
IsCleanMethod · 0.45

Tested by

no test coverage detected