MCPcopy Create free account
hub / github.com/go-git/go-git / testObjectsWithPrefix

Function testObjectsWithPrefix

storage/filesystem/dotgit/dotgit_test.go:617–629  ·  view source on GitHub ↗
(c *C, fs billy.Filesystem, dir *DotGit)

Source from the content-addressed store, hash-verified

615}
616
617func testObjectsWithPrefix(c *C, fs billy.Filesystem, dir *DotGit) {
618 prefix, _ := hex.DecodeString("01d5")
619 hashes, err := dir.ObjectsWithPrefix(prefix)
620 c.Assert(err, IsNil)
621 c.Assert(hashes, HasLen, 1)
622 c.Assert(hashes[0].String(), Equals, "01d5fa556c33743006de7e76e67a2dfcd994ca04")
623
624 // Empty prefix should yield all objects.
625 // (subset of testObjects)
626 hashes, err = dir.ObjectsWithPrefix(nil)
627 c.Assert(err, IsNil)
628 c.Assert(hashes, HasLen, 187)
629}
630
631func (s *SuiteDotGit) TestObjectsNoFolder(c *C) {
632 fs, clean := s.TemporalFilesystem()

Callers 2

TestObjectsMethod · 0.85
TestObjectsExclusiveMethod · 0.85

Calls 2

ObjectsWithPrefixMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected