(c *C)
| 303 | } |
| 304 | |
| 305 | func (s *RemoteSuite) TestFetchWithDepthChange(c *C) { |
| 306 | r := NewRemote(memory.NewStorage(), &config.RemoteConfig{ |
| 307 | URLs: []string{s.GetBasicLocalRepositoryURL()}, |
| 308 | }) |
| 309 | |
| 310 | s.testFetch(c, r, &FetchOptions{ |
| 311 | Depth: 1, |
| 312 | RefSpecs: []config.RefSpec{ |
| 313 | config.RefSpec("refs/heads/master:refs/heads/master"), |
| 314 | }, |
| 315 | }, []*plumbing.Reference{ |
| 316 | plumbing.NewReferenceFromStrings("refs/heads/master", "6ecf0ef2c2dffb796033e5a02219af86ec6584e5"), |
| 317 | }) |
| 318 | c.Assert(r.s.(*memory.Storage).Commits, HasLen, 1) |
| 319 | |
| 320 | s.testFetch(c, r, &FetchOptions{ |
| 321 | Depth: 3, |
| 322 | RefSpecs: []config.RefSpec{ |
| 323 | config.RefSpec("refs/heads/master:refs/heads/master"), |
| 324 | }, |
| 325 | }, []*plumbing.Reference{ |
| 326 | plumbing.NewReferenceFromStrings("refs/heads/master", "6ecf0ef2c2dffb796033e5a02219af86ec6584e5"), |
| 327 | }) |
| 328 | c.Assert(r.s.(*memory.Storage).Commits, HasLen, 3) |
| 329 | } |
| 330 | |
| 331 | func (s *RemoteSuite) testFetch(c *C, r *Remote, o *FetchOptions, expected []*plumbing.Reference) { |
| 332 | err := r.Fetch(o) |
nothing calls this directly
no test coverage detected