(c *C)
| 1181 | } |
| 1182 | |
| 1183 | func (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 | |
| 1219 | func (s *RepositorySuite) TestPlainCloneNoCheckout(c *C) { |
| 1220 | dir := c.MkDir() |
nothing calls this directly
no test coverage detected