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

Function test_diff_empty_index

test/test_diff.py:177–187  ·  view source on GitHub ↗
(dirtyrepo: Repository)

Source from the content-addressed store, hash-verified

175
176
177def test_diff_empty_index(dirtyrepo: Repository) -> None:
178 repo = dirtyrepo
179 head = repo[repo.lookup_reference('HEAD').resolve().target]
180
181 diff = head.tree.diff_to_index(repo.index)
182 files = [patch.delta.new_file.path for patch in diff_safeiter(diff)]
183 assert DIFF_HEAD_TO_INDEX_EXPECTED == files
184
185 diff = repo.diff('HEAD', cached=True)
186 files = [patch.delta.new_file.path for patch in diff_safeiter(diff)]
187 assert DIFF_HEAD_TO_INDEX_EXPECTED == files
188
189
190def test_workdir_to_tree(dirtyrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 2

diff_safeiterFunction · 0.85
diffMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…