(c *C)
| 1287 | } |
| 1288 | |
| 1289 | func (s *RepositorySuite) TestCloneDeep(c *C) { |
| 1290 | fs := memfs.New() |
| 1291 | r, _ := Init(memory.NewStorage(), fs) |
| 1292 | |
| 1293 | head, err := r.Head() |
| 1294 | c.Assert(err, Equals, plumbing.ErrReferenceNotFound) |
| 1295 | c.Assert(head, IsNil) |
| 1296 | |
| 1297 | err = r.clone(context.Background(), &CloneOptions{ |
| 1298 | URL: s.GetBasicLocalRepositoryURL(), |
| 1299 | }) |
| 1300 | |
| 1301 | c.Assert(err, IsNil) |
| 1302 | |
| 1303 | remotes, err := r.Remotes() |
| 1304 | c.Assert(err, IsNil) |
| 1305 | c.Assert(remotes, HasLen, 1) |
| 1306 | |
| 1307 | head, err = r.Reference(plumbing.HEAD, false) |
| 1308 | c.Assert(err, IsNil) |
| 1309 | c.Assert(head, NotNil) |
| 1310 | c.Assert(head.Type(), Equals, plumbing.SymbolicReference) |
| 1311 | c.Assert(head.Target().String(), Equals, "refs/heads/master") |
| 1312 | |
| 1313 | branch, err := r.Reference(head.Target(), false) |
| 1314 | c.Assert(err, IsNil) |
| 1315 | c.Assert(branch, NotNil) |
| 1316 | c.Assert(branch.Hash().String(), Equals, "6ecf0ef2c2dffb796033e5a02219af86ec6584e5") |
| 1317 | |
| 1318 | branch, err = r.Reference("refs/remotes/origin/master", false) |
| 1319 | c.Assert(err, IsNil) |
| 1320 | c.Assert(branch, NotNil) |
| 1321 | c.Assert(branch.Type(), Equals, plumbing.HashReference) |
| 1322 | c.Assert(branch.Hash().String(), Equals, "6ecf0ef2c2dffb796033e5a02219af86ec6584e5") |
| 1323 | |
| 1324 | fi, err := fs.ReadDir("") |
| 1325 | c.Assert(err, IsNil) |
| 1326 | c.Assert(fi, HasLen, 8) |
| 1327 | } |
| 1328 | |
| 1329 | func (s *RepositorySuite) TestCloneConfig(c *C) { |
| 1330 | r, _ := Init(memory.NewStorage(), nil) |
nothing calls this directly
no test coverage detected