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

Function test_diff_stats

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

Source from the content-addressed store, hash-verified

394
395
396def test_diff_stats(barerepo: Repository) -> None:
397 commit_a = barerepo[COMMIT_SHA1_1]
398 commit_b = barerepo[COMMIT_SHA1_2]
399
400 diff = commit_a.tree.diff_to_tree(commit_b.tree)
401 stats = diff.stats
402 assert 1 == stats.insertions
403 assert 2 == stats.deletions
404 assert 2 == stats.files_changed
405 formatted = stats.format(
406 format=DiffStatsFormat.FULL | DiffStatsFormat.INCLUDE_SUMMARY, width=80
407 )
408 assert STATS_EXPECTED == formatted
409
410
411def test_deltas(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…