MCPcopy Index your code
hub / github.com/go-git/go-git / TestPushDeleteReference

Method TestPushDeleteReference

remote_test.go:776–800  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 8

NewStorageFunction · 0.92
NewObjectLRUDefaultFunction · 0.92
ReferenceNameTypeAlias · 0.92
PlainCloneFunction · 0.85
RootMethod · 0.80
RemoteMethod · 0.80
PushMethod · 0.65
ReferenceMethod · 0.65

Tested by

no test coverage detected