| 242 | } |
| 243 | |
| 244 | func (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 | |
| 273 | func (s *SubmoduleSuite) TestSubmoduleParseScp(c *C) { |
| 274 | repo := &Repository{ |