(c *C)
| 643 | } |
| 644 | |
| 645 | func (s *RemoteSuite) TestPushContextCanceled(c *C) { |
| 646 | url := c.MkDir() |
| 647 | |
| 648 | _, err := PlainInit(url, true) |
| 649 | c.Assert(err, IsNil) |
| 650 | |
| 651 | fs := fixtures.ByURL("https://github.com/git-fixtures/tags.git").One().DotGit() |
| 652 | sto := filesystem.NewStorage(fs, cache.NewObjectLRUDefault()) |
| 653 | |
| 654 | r := NewRemote(sto, &config.RemoteConfig{ |
| 655 | Name: DefaultRemoteName, |
| 656 | URLs: []string{url}, |
| 657 | }) |
| 658 | |
| 659 | ctx, cancel := context.WithCancel(context.Background()) |
| 660 | cancel() |
| 661 | |
| 662 | numGoroutines := runtime.NumGoroutine() |
| 663 | |
| 664 | err = r.PushContext(ctx, &PushOptions{ |
| 665 | RefSpecs: []config.RefSpec{"refs/tags/*:refs/tags/*"}, |
| 666 | }) |
| 667 | c.Assert(err, Equals, context.Canceled) |
| 668 | |
| 669 | eventually(c, func() bool { |
| 670 | return runtime.NumGoroutine() <= numGoroutines |
| 671 | }) |
| 672 | } |
| 673 | |
| 674 | func (s *RemoteSuite) TestPushTags(c *C) { |
| 675 | url := c.MkDir() |
nothing calls this directly
no test coverage detected