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

Method TestInitStandardDotGit

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

Source from the content-addressed store, hash-verified

138}
139
140func (s *RepositorySuite) TestInitStandardDotGit(c *C) {
141 dir := c.MkDir()
142
143 fs := osfs.New(dir)
144 dot, _ := fs.Chroot(".git")
145 st := filesystem.NewStorage(dot, cache.NewObjectLRUDefault())
146
147 r, err := Init(st, fs)
148 c.Assert(err, IsNil)
149 c.Assert(r, NotNil)
150
151 l, err := fs.ReadDir(".git")
152 c.Assert(err, IsNil)
153 c.Assert(len(l) > 0, Equals, true)
154
155 cfg, err := r.Config()
156 c.Assert(err, IsNil)
157 c.Assert(cfg.Core.Worktree, Equals, "")
158}
159
160func (s *RepositorySuite) TestInitBare(c *C) {
161 r, err := Init(memory.NewStorage(), nil)

Callers

nothing calls this directly

Calls 6

NewStorageFunction · 0.92
NewObjectLRUDefaultFunction · 0.92
InitFunction · 0.85
ConfigMethod · 0.65
ChrootMethod · 0.45
ReadDirMethod · 0.45

Tested by

no test coverage detected