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

Method TestPlainCloneWithShallowSubmodules

repository_test.go:1183–1217  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

1181}
1182
1183func (s *RepositorySuite) TestPlainCloneWithShallowSubmodules(c *C) {
1184 if testing.Short() {
1185 c.Skip("skipping test in short mode.")
1186 }
1187
1188 dir := c.MkDir()
1189
1190 path := fixtures.ByTag("submodule").One().Worktree().Root()
1191 mainRepo, err := PlainClone(dir, false, &CloneOptions{
1192 URL: path,
1193 RecurseSubmodules: 1,
1194 ShallowSubmodules: true,
1195 })
1196 c.Assert(err, IsNil)
1197
1198 mainWorktree, err := mainRepo.Worktree()
1199 c.Assert(err, IsNil)
1200
1201 submodule, err := mainWorktree.Submodule("basic")
1202 c.Assert(err, IsNil)
1203
1204 subRepo, err := submodule.Repository()
1205 c.Assert(err, IsNil)
1206
1207 lr, err := subRepo.Log(&LogOptions{})
1208 c.Assert(err, IsNil)
1209
1210 commitCount := 0
1211 for _, err := lr.Next(); err == nil; _, err = lr.Next() {
1212 commitCount++
1213 }
1214 c.Assert(err, IsNil)
1215
1216 c.Assert(commitCount, Equals, 1)
1217}
1218
1219func (s *RepositorySuite) TestPlainCloneNoCheckout(c *C) {
1220 dir := c.MkDir()

Callers

nothing calls this directly

Calls 9

PlainCloneFunction · 0.85
ShortMethod · 0.80
RootMethod · 0.80
WorktreeMethod · 0.80
SubmoduleMethod · 0.80
RepositoryMethod · 0.80
LogMethod · 0.80
SkipMethod · 0.65
NextMethod · 0.65

Tested by

no test coverage detected