MCPcopy
hub / github.com/go-git/go-git / TestDeleteBranch

Method TestDeleteBranch

repository_test.go:617–637  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

615}
616
617func (s *RepositorySuite) TestDeleteBranch(c *C) {
618 r, _ := Init(memory.NewStorage(), nil)
619 testBranch := &config.Branch{
620 Name: "foo",
621 Remote: "origin",
622 Merge: "refs/heads/foo",
623 }
624 err := r.CreateBranch(testBranch)
625
626 c.Assert(err, IsNil)
627
628 err = r.DeleteBranch("foo")
629 c.Assert(err, IsNil)
630
631 b, err := r.Branch("foo")
632 c.Assert(err, Equals, ErrBranchNotFound)
633 c.Assert(b, IsNil)
634
635 err = r.DeleteBranch("foo")
636 c.Assert(err, Equals, ErrBranchNotFound)
637}
638
639func (s *RepositorySuite) TestPlainInit(c *C) {
640 dir := c.MkDir()

Callers

nothing calls this directly

Calls 5

NewStorageFunction · 0.92
InitFunction · 0.85
CreateBranchMethod · 0.80
DeleteBranchMethod · 0.80
BranchMethod · 0.80

Tested by

no test coverage detected