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

Class ProxyBackend

test/test_odb_backend.py:70–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69
70class ProxyBackend(pygit2.OdbBackend):
71 def __init__(self, source: pygit2.OdbBackend | pygit2.OdbBackendPack) -> None:
72 super().__init__()
73 self.source = source
74
75 def read_cb(self, oid: Oid | str) -> tuple[int, bytes]:
76 return self.source.read(oid)
77
78 def read_prefix_cb(self, oid: Oid | str) -> tuple[int, bytes, Oid]:
79 return self.source.read_prefix(oid)
80
81 def read_header_cb(self, oid: Oid | str) -> tuple[int, int]:
82 typ, data = self.source.read(oid)
83 return typ, len(data)
84
85 def exists_cb(self, oid: Oid | str) -> bool:
86 return self.source.exists(oid)
87
88 def exists_prefix_cb(self, oid: Oid | str) -> Oid:
89 return self.source.exists_prefix(oid)
90
91 def refresh_cb(self) -> None:
92 self.source.refresh()
93
94 def __iter__(self) -> Iterator[Oid]:
95 return iter(self.source)
96
97
98#

Callers 2

proxyFunction · 0.85
repoFunction · 0.85

Calls

no outgoing calls

Tested by 2

proxyFunction · 0.68
repoFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…