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

Class ProxyRefdbBackend

test/test_refdb_backend.py:42–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40# incomplete, to avoid hitting the semi-valid states that refdbs produce by
41# design.
42class ProxyRefdbBackend(pygit2.RefdbBackend):
43 def __init__(self, source: pygit2.RefdbBackend) -> None:
44 self.source = source
45
46 def exists(self, ref: str) -> bool:
47 return self.source.exists(ref)
48
49 def lookup(self, ref: str) -> Reference:
50 return self.source.lookup(ref)
51
52 def write(
53 self,
54 ref: Reference,
55 force: bool,
56 who: Signature,
57 message: str,
58 old: None | str | Oid,
59 old_target: None | str,
60 ) -> None:
61 return self.source.write(ref, force, who, message, old, old_target)
62
63 def rename(
64 self, old_name: str, new_name: str, force: bool, who: Signature, message: str
65 ) -> Reference:
66 return self.source.rename(old_name, new_name, force, who, message)
67
68 def delete(self, ref_name: str, old_id: Oid | str, old_target: str | None) -> None:
69 return self.source.delete(ref_name, old_id, old_target)
70
71 def compress(self) -> None:
72 return self.source.compress()
73
74 def has_log(self, ref_name: str) -> bool:
75 return self.source.has_log(ref_name)
76
77 def ensure_log(self, ref_name: str) -> bool:
78 return self.source.ensure_log(ref_name)
79
80
81@pytest.fixture

Callers 1

repoFunction · 0.85

Calls

no outgoing calls

Tested by 1

repoFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…