MCPcopy
hub / github.com/go-git/go-git / TestUpdate

Method TestUpdate

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

Source from the content-addressed store, hash-verified

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