MCPcopy Create free account
hub / github.com/go-git/go-git / TestPushDeleteReference

Method TestPushDeleteReference

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

Source from the content-addressed store, hash-verified

747}
748
749func (s *RemoteSuite) TestPushDeleteReference(c *C) {
750 fs := fixtures.Basic().One().DotGit()
751 sto := filesystem.NewStorage(fs, cache.NewObjectLRUDefault())
752
753 url, clean := s.TemporalDir()
754 defer clean()
755
756 r, err := PlainClone(url, true, &CloneOptions{
757 URL: fs.Root(),
758 })
759 c.Assert(err, IsNil)
760
761 remote, err := r.Remote(DefaultRemoteName)
762 c.Assert(err, IsNil)
763
764 err = remote.Push(&PushOptions{
765 RefSpecs: []config.RefSpec{":refs/heads/branch"},
766 })
767 c.Assert(err, IsNil)
768
769 _, err = sto.Reference(plumbing.ReferenceName("refs/heads/branch"))
770 c.Assert(err, Equals, plumbing.ErrReferenceNotFound)
771
772 _, err = r.Storer.Reference(plumbing.ReferenceName("refs/heads/branch"))
773 c.Assert(err, Equals, plumbing.ErrReferenceNotFound)
774}
775
776func (s *RemoteSuite) TestForcePushDeleteReference(c *C) {
777 fs := fixtures.Basic().One().DotGit()

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected