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

Function test_diff_tree_opts

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

Source from the content-addressed store, hash-verified

291
292
293def test_diff_tree_opts(barerepo: Repository) -> None:
294 commit_c = barerepo[COMMIT_SHA1_3]
295 commit_d = barerepo[COMMIT_SHA1_4]
296
297 for flag in [DiffOption.IGNORE_WHITESPACE, DiffOption.IGNORE_WHITESPACE_EOL]:
298 diff = commit_c.tree.diff_to_tree(commit_d.tree, flag)
299 assert diff is not None
300 patch = diff[0]
301 assert patch is not None
302 assert 0 == len(patch.hunks)
303
304 diff = commit_c.tree.diff_to_tree(commit_d.tree)
305 assert diff is not None
306 patch = diff[0]
307 assert patch is not None
308 assert 1 == len(patch.hunks)
309
310
311def test_diff_merge(barerepo: Repository) -> None:

Callers

nothing calls this directly

Calls 1

diff_to_treeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…