(c *C)
| 601 | } |
| 602 | |
| 603 | func (s *RemoteSuite) TestPushContext(c *C) { |
| 604 | url := c.MkDir() |
| 605 | |
| 606 | _, err := PlainInit(url, true) |
| 607 | c.Assert(err, IsNil) |
| 608 | |
| 609 | fs := fixtures.ByURL("https://github.com/git-fixtures/tags.git").One().DotGit() |
| 610 | sto := filesystem.NewStorage(fs, cache.NewObjectLRUDefault()) |
| 611 | |
| 612 | r := NewRemote(sto, &config.RemoteConfig{ |
| 613 | Name: DefaultRemoteName, |
| 614 | URLs: []string{url}, |
| 615 | }) |
| 616 | |
| 617 | ctx, cancel := context.WithCancel(context.Background()) |
| 618 | defer cancel() |
| 619 | |
| 620 | numGoroutines := runtime.NumGoroutine() |
| 621 | |
| 622 | err = r.PushContext(ctx, &PushOptions{ |
| 623 | RefSpecs: []config.RefSpec{"refs/tags/*:refs/tags/*"}, |
| 624 | }) |
| 625 | c.Assert(err, IsNil) |
| 626 | |
| 627 | eventually(c, func() bool { |
| 628 | return runtime.NumGoroutine() <= numGoroutines |
| 629 | }) |
| 630 | } |
| 631 | |
| 632 | func eventually(c *C, condition func() bool) { |
| 633 | select { |
nothing calls this directly
no test coverage detected