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

Method TestInitWithOptions

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

Source from the content-addressed store, hash-verified

62}
63
64func (s *RepositorySuite) TestInitWithOptions(c *C) {
65 r, err := InitWithOptions(memory.NewStorage(), memfs.New(), InitOptions{
66 DefaultBranch: "refs/heads/foo",
67 })
68 c.Assert(err, IsNil)
69 c.Assert(r, NotNil)
70 createCommit(c, r)
71
72 ref, err := r.Head()
73 c.Assert(err, IsNil)
74 c.Assert(ref.Name().String(), Equals, "refs/heads/foo")
75
76}
77
78func (s *RepositorySuite) TestInitWithInvalidDefaultBranch(c *C) {
79 _, err := InitWithOptions(memory.NewStorage(), memfs.New(), InitOptions{

Callers

nothing calls this directly

Calls 6

NewStorageFunction · 0.92
InitWithOptionsFunction · 0.85
createCommitFunction · 0.85
HeadMethod · 0.80
StringMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected