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

Function test_diff_empty_index_bare

test/test_diff.py:218–232  ·  view source on GitHub ↗
(barerepo: Repository)

Source from the content-addressed store, hash-verified

216
217
218def test_diff_empty_index_bare(barerepo: Repository) -> None:
219 repo = barerepo
220 head = repo[repo.lookup_reference('HEAD').resolve().target]
221
222 diff = barerepo.index.diff_to_tree(head.tree)
223 files = [patch.delta.new_file.path.split('/')[0] for patch in diff_safeiter(diff)]
224 assert [x.name for x in head.tree] == files
225
226 diff = head.tree.diff_to_index(repo.index)
227 files = [patch.delta.new_file.path.split('/')[0] for patch in diff_safeiter(diff)]
228 assert [x.name for x in head.tree] == files
229
230 diff = repo.diff('HEAD', cached=True)
231 files = [patch.delta.new_file.path.split('/')[0] for patch in diff_safeiter(diff)]
232 assert [x.name for x in head.tree] == files
233
234
235def test_diff_tree(barerepo: Repository) -> None:

Callers

nothing calls this directly

Calls 3

diff_safeiterFunction · 0.85
diff_to_treeMethod · 0.80
diffMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…