(c *C)
| 883 | } |
| 884 | |
| 885 | func (s *RemoteSuite) TestPushForceWithOption(c *C) { |
| 886 | f := fixtures.Basic().One() |
| 887 | sto := filesystem.NewStorage(f.DotGit(), cache.NewObjectLRUDefault()) |
| 888 | |
| 889 | dstFs := f.DotGit() |
| 890 | dstSto := filesystem.NewStorage(dstFs, cache.NewObjectLRUDefault()) |
| 891 | |
| 892 | url := dstFs.Root() |
| 893 | r := NewRemote(sto, &config.RemoteConfig{ |
| 894 | Name: DefaultRemoteName, |
| 895 | URLs: []string{url}, |
| 896 | }) |
| 897 | |
| 898 | oldRef, err := dstSto.Reference(plumbing.ReferenceName("refs/heads/branch")) |
| 899 | c.Assert(err, IsNil) |
| 900 | c.Assert(oldRef, NotNil) |
| 901 | |
| 902 | err = r.Push(&PushOptions{ |
| 903 | RefSpecs: []config.RefSpec{"refs/heads/master:refs/heads/branch"}, |
| 904 | Force: true, |
| 905 | }) |
| 906 | c.Assert(err, IsNil) |
| 907 | |
| 908 | newRef, err := dstSto.Reference(plumbing.ReferenceName("refs/heads/branch")) |
| 909 | c.Assert(err, IsNil) |
| 910 | c.Assert(newRef, Not(DeepEquals), oldRef) |
| 911 | } |
| 912 | |
| 913 | func (s *RemoteSuite) TestPushForceWithLease_success(c *C) { |
| 914 | testCases := []struct { |
nothing calls this directly
no test coverage detected