(c *C)
| 774 | } |
| 775 | |
| 776 | func (s *RemoteSuite) TestForcePushDeleteReference(c *C) { |
| 777 | fs := fixtures.Basic().One().DotGit() |
| 778 | sto := filesystem.NewStorage(fs, cache.NewObjectLRUDefault()) |
| 779 | |
| 780 | url, clean := s.TemporalDir() |
| 781 | defer clean() |
| 782 | |
| 783 | r, err := PlainClone(url, true, &CloneOptions{ |
| 784 | URL: fs.Root(), |
| 785 | }) |
| 786 | c.Assert(err, IsNil) |
| 787 | |
| 788 | remote, err := r.Remote(DefaultRemoteName) |
| 789 | c.Assert(err, IsNil) |
| 790 | |
| 791 | err = remote.Push(&PushOptions{ |
| 792 | RefSpecs: []config.RefSpec{":refs/heads/branch"}, |
| 793 | Force: true, |
| 794 | }) |
| 795 | c.Assert(err, IsNil) |
| 796 | |
| 797 | _, err = sto.Reference(plumbing.ReferenceName("refs/heads/branch")) |
| 798 | c.Assert(err, Equals, plumbing.ErrReferenceNotFound) |
| 799 | |
| 800 | _, err = r.Storer.Reference(plumbing.ReferenceName("refs/heads/branch")) |
| 801 | c.Assert(err, Equals, plumbing.ErrReferenceNotFound) |
| 802 | } |
| 803 | |
| 804 | func (s *RemoteSuite) TestPushRejectNonFastForward(c *C) { |
| 805 | fs := fixtures.Basic().One().DotGit() |
nothing calls this directly
no test coverage detected