MCPcopy Create free account
hub / github.com/libgit2/pygit2 / repo

Function repo

test/test_repository_custom.py:37–51  ·  view source on GitHub ↗
(testrepopacked: Repository)

Source from the content-addressed store, hash-verified

35
36@pytest.fixture
37def repo(testrepopacked: Repository) -> Generator[Repository, None, None]:
38 testrepo = testrepopacked
39
40 odb = pygit2.Odb()
41 object_path = Path(testrepo.path) / 'objects'
42 odb.add_backend(pygit2.OdbBackendPack(object_path), 1)
43 odb.add_backend(pygit2.OdbBackendLoose(object_path, 0, False), 1)
44
45 refdb = pygit2.Refdb.new(testrepo)
46 refdb.set_backend(pygit2.RefdbFsBackend(testrepo))
47
48 repo = pygit2.Repository()
49 repo.set_odb(odb)
50 repo.set_refdb(refdb)
51 yield repo
52
53
54def test_references(repo: Repository) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…