(c *C)
| 350 | } |
| 351 | |
| 352 | func (s *RemoteSuite) TestFetchOfMissingObjects(c *C) { |
| 353 | tmp := c.MkDir() |
| 354 | |
| 355 | // clone to a local temp folder |
| 356 | _, err := PlainClone(tmp, true, &CloneOptions{ |
| 357 | URL: fixtures.Basic().One().DotGit().Root(), |
| 358 | }) |
| 359 | c.Assert(err, IsNil) |
| 360 | |
| 361 | // Delete the pack files |
| 362 | fsTmp := osfs.New(tmp) |
| 363 | err = util.RemoveAll(fsTmp, "objects/pack") |
| 364 | c.Assert(err, IsNil) |
| 365 | |
| 366 | // Reopen the repo from the filesystem (with missing objects) |
| 367 | r, err := Open(filesystem.NewStorage(fsTmp, cache.NewObjectLRUDefault()), nil) |
| 368 | c.Assert(err, IsNil) |
| 369 | |
| 370 | // Confirm we are missing a commit |
| 371 | _, err = r.CommitObject(plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")) |
| 372 | c.Assert(err, Equals, plumbing.ErrObjectNotFound) |
| 373 | |
| 374 | // Refetch to get all the missing objects |
| 375 | err = r.Fetch(&FetchOptions{}) |
| 376 | c.Assert(err, IsNil) |
| 377 | |
| 378 | // Confirm we now have the commit |
| 379 | _, err = r.CommitObject(plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")) |
| 380 | c.Assert(err, IsNil) |
| 381 | } |
| 382 | |
| 383 | func (s *RemoteSuite) TestFetchWithProgress(c *C) { |
| 384 | url := s.GetBasicLocalRepositoryURL() |
nothing calls this directly
no test coverage detected