MCPcopy Index your code
hub / github.com/go-git/go-git / TestIndexWriteAndIndex

Method TestIndexWriteAndIndex

storage/filesystem/dotgit/dotgit_test.go:424–442  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

422}
423
424func (s *SuiteDotGit) TestIndexWriteAndIndex(c *C) {
425 fs := s.TemporalFilesystem(c)
426
427 dir := New(fs)
428
429 f, err := dir.IndexWriter()
430 c.Assert(err, IsNil)
431
432 _, err = f.Write([]byte("foo"))
433 c.Assert(err, IsNil)
434
435 f, err = dir.Index()
436 c.Assert(err, IsNil)
437
438 cnt, err := io.ReadAll(f)
439 c.Assert(err, IsNil)
440
441 c.Assert(string(cnt), Equals, "foo")
442}
443
444func (s *SuiteDotGit) TestShallow(c *C) {
445 fs := fixtures.Basic().ByTag(".git").One().DotGit()

Callers

nothing calls this directly

Calls 5

TemporalFilesystemMethod · 0.95
IndexWriterMethod · 0.80
NewFunction · 0.70
IndexMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected