(c *C)
| 1327 | } |
| 1328 | |
| 1329 | func (s *RepositorySuite) TestCloneConfig(c *C) { |
| 1330 | r, _ := Init(memory.NewStorage(), nil) |
| 1331 | |
| 1332 | head, err := r.Head() |
| 1333 | c.Assert(err, Equals, plumbing.ErrReferenceNotFound) |
| 1334 | c.Assert(head, IsNil) |
| 1335 | |
| 1336 | err = r.clone(context.Background(), &CloneOptions{ |
| 1337 | URL: s.GetBasicLocalRepositoryURL(), |
| 1338 | }) |
| 1339 | |
| 1340 | c.Assert(err, IsNil) |
| 1341 | |
| 1342 | cfg, err := r.Config() |
| 1343 | c.Assert(err, IsNil) |
| 1344 | |
| 1345 | c.Assert(cfg.Core.IsBare, Equals, true) |
| 1346 | c.Assert(cfg.Remotes, HasLen, 1) |
| 1347 | c.Assert(cfg.Remotes["origin"].Name, Equals, "origin") |
| 1348 | c.Assert(cfg.Remotes["origin"].URLs, HasLen, 1) |
| 1349 | c.Assert(cfg.Branches, HasLen, 1) |
| 1350 | c.Assert(cfg.Branches["master"].Name, Equals, "master") |
| 1351 | } |
| 1352 | |
| 1353 | func (s *RepositorySuite) TestCloneSingleBranchAndNonHEAD(c *C) { |
| 1354 | s.testCloneSingleBranchAndNonHEADReference(c, "refs/heads/branch") |
nothing calls this directly
no test coverage detected