(c *C)
| 859 | } |
| 860 | |
| 861 | func (s *RemoteSuite) TestPushForceWithOption(c *C) { |
| 862 | f := fixtures.Basic().One() |
| 863 | sto := filesystem.NewStorage(f.DotGit(), cache.NewObjectLRUDefault()) |
| 864 | |
| 865 | dstFs := f.DotGit() |
| 866 | dstSto := filesystem.NewStorage(dstFs, cache.NewObjectLRUDefault()) |
| 867 | |
| 868 | url := dstFs.Root() |
| 869 | r := NewRemote(sto, &config.RemoteConfig{ |
| 870 | Name: DefaultRemoteName, |
| 871 | URLs: []string{url}, |
| 872 | }) |
| 873 | |
| 874 | oldRef, err := dstSto.Reference(plumbing.ReferenceName("refs/heads/branch")) |
| 875 | c.Assert(err, IsNil) |
| 876 | c.Assert(oldRef, NotNil) |
| 877 | |
| 878 | err = r.Push(&PushOptions{ |
| 879 | RefSpecs: []config.RefSpec{"refs/heads/master:refs/heads/branch"}, |
| 880 | Force: true, |
| 881 | }) |
| 882 | c.Assert(err, IsNil) |
| 883 | |
| 884 | newRef, err := dstSto.Reference(plumbing.ReferenceName("refs/heads/branch")) |
| 885 | c.Assert(err, IsNil) |
| 886 | c.Assert(newRef, Not(DeepEquals), oldRef) |
| 887 | } |
| 888 | |
| 889 | func (s *RemoteSuite) TestPushForceWithLease_success(c *C) { |
| 890 | testCases := []struct { |
nothing calls this directly
no test coverage detected