MCPcopy Index your code
hub / github.com/go-git/go-git / TestSubmodulesFetchDepth

Method TestSubmodulesFetchDepth

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

Source from the content-addressed store, hash-verified

242}
243
244func (s *SubmoduleSuite) TestSubmodulesFetchDepth(c *C) {
245 if testing.Short() {
246 c.Skip("skipping test in short mode.")
247 }
248
249 sm, err := s.Worktree.Submodule("basic")
250 c.Assert(err, IsNil)
251
252 err = sm.Update(&SubmoduleUpdateOptions{
253 Init: true,
254 Depth: 1,
255 })
256 c.Assert(err, IsNil)
257
258 r, err := sm.Repository()
259 c.Assert(err, IsNil)
260
261 lr, err := r.Log(&LogOptions{})
262 c.Assert(err, IsNil)
263
264 commitCount := 0
265 for _, err := lr.Next(); err == nil; _, err = lr.Next() {
266 commitCount++
267 }
268 c.Assert(err, IsNil)
269
270 c.Assert(commitCount, Equals, 1)
271}
272
273func (s *SubmoduleSuite) TestSubmoduleParseScp(c *C) {
274 repo := &Repository{

Callers

nothing calls this directly

Calls 7

ShortMethod · 0.80
SubmoduleMethod · 0.80
RepositoryMethod · 0.80
LogMethod · 0.80
SkipMethod · 0.65
NextMethod · 0.65
UpdateMethod · 0.45

Tested by

no test coverage detected