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

Function test_obj

test/test_object.py:122–131  ·  view source on GitHub ↗
(obj: Object | Commit, msg: str)

Source from the content-addressed store, hash-verified

120 seen: dict[str, Oid] = {} # from short_id to full hex id
121
122 def test_obj(obj: Object | Commit, msg: str) -> None:
123 short_id = obj.short_id
124 msg = msg + f' short_id={short_id}'
125 already = seen.get(short_id)
126 if already:
127 assert already == obj.id
128 else:
129 seen[short_id] = obj.id
130 lookup = testrepo[short_id]
131 assert obj.id == lookup.id
132
133 for commit in testrepo.walk(testrepo.head.target):
134 test_obj(commit, f'commit#{commit.id}')

Callers 1

test_short_idFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…