(c *C)
| 410 | } |
| 411 | |
| 412 | func (s *RemoteSuite) TestFetchWithPackfileWriter(c *C) { |
| 413 | fs := s.TemporalFilesystem(c) |
| 414 | |
| 415 | fss := filesystem.NewStorage(fs, cache.NewObjectLRUDefault()) |
| 416 | mock := &mockPackfileWriter{Storer: fss} |
| 417 | |
| 418 | url := s.GetBasicLocalRepositoryURL() |
| 419 | r := NewRemote(mock, &config.RemoteConfig{Name: "foo", URLs: []string{url}}) |
| 420 | |
| 421 | refspec := config.RefSpec("+refs/heads/*:refs/remotes/origin/*") |
| 422 | err := r.Fetch(&FetchOptions{ |
| 423 | RefSpecs: []config.RefSpec{refspec}, |
| 424 | }) |
| 425 | |
| 426 | c.Assert(err, IsNil) |
| 427 | |
| 428 | var count int |
| 429 | iter, err := mock.IterEncodedObjects(plumbing.AnyObject) |
| 430 | c.Assert(err, IsNil) |
| 431 | |
| 432 | iter.ForEach(func(plumbing.EncodedObject) error { |
| 433 | count++ |
| 434 | return nil |
| 435 | }) |
| 436 | |
| 437 | c.Assert(count, Equals, 31) |
| 438 | c.Assert(mock.PackfileWriterCalled, Equals, true) |
| 439 | } |
| 440 | |
| 441 | func (s *RemoteSuite) TestFetchNoErrAlreadyUpToDate(c *C) { |
| 442 | url := s.GetBasicLocalRepositoryURL() |
nothing calls this directly
no test coverage detected