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

Method TestPlainInitWithOptions

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

Source from the content-addressed store, hash-verified

649}
650
651func (s *RepositorySuite) TestPlainInitWithOptions(c *C) {
652 dir := c.MkDir()
653
654 r, err := PlainInitWithOptions(dir, &PlainInitOptions{
655 InitOptions: InitOptions{
656 DefaultBranch: "refs/heads/foo",
657 },
658 Bare: false,
659 })
660 c.Assert(err, IsNil)
661 c.Assert(r, NotNil)
662
663 cfg, err := r.Config()
664 c.Assert(err, IsNil)
665 c.Assert(cfg.Core.IsBare, Equals, false)
666
667 createCommit(c, r)
668
669 ref, err := r.Head()
670 c.Assert(err, IsNil)
671 c.Assert(ref.Name().String(), Equals, "refs/heads/foo")
672}
673
674func (s *RepositorySuite) TestPlainInitAlreadyExists(c *C) {
675 dir := c.MkDir()

Callers

nothing calls this directly

Calls 6

PlainInitWithOptionsFunction · 0.85
createCommitFunction · 0.85
HeadMethod · 0.80
ConfigMethod · 0.65
StringMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected