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

Method TestInit

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

Source from the content-addressed store, hash-verified

46var _ = Suite(&RepositorySuite{})
47
48func (s *RepositorySuite) TestInit(c *C) {
49 r, err := Init(memory.NewStorage(), memfs.New())
50 c.Assert(err, IsNil)
51 c.Assert(r, NotNil)
52
53 cfg, err := r.Config()
54 c.Assert(err, IsNil)
55 c.Assert(cfg.Core.IsBare, Equals, false)
56
57 // check the HEAD to see what the default branch is
58 createCommit(c, r)
59 ref, err := r.Head()
60 c.Assert(err, IsNil)
61 c.Assert(ref.Name().String(), Equals, plumbing.Master.String())
62}
63
64func (s *RepositorySuite) TestInitWithOptions(c *C) {
65 r, err := InitWithOptions(memory.NewStorage(), memfs.New(), InitOptions{

Callers

nothing calls this directly

Calls 7

NewStorageFunction · 0.92
InitFunction · 0.85
createCommitFunction · 0.85
HeadMethod · 0.80
ConfigMethod · 0.65
StringMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected