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