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

Function test_add_conflict

test/test_index.py:320–339  ·  view source on GitHub ↗
(testrepo: Repository)

Source from the content-addressed store, hash-verified

318
319@utils.fails_in_macos
320def test_add_conflict(testrepo: Repository) -> None:
321 ancestor_blob_id = testrepo.create_blob('ancestor')
322 ancestor = IndexEntry('conflict.txt', ancestor_blob_id, FileMode.BLOB_EXECUTABLE)
323
324 ours_blob_id = testrepo.create_blob('ours')
325 ours = IndexEntry('conflict.txt', ours_blob_id, FileMode.BLOB)
326
327 index = Index()
328 assert index.conflicts is None
329
330 index.add_conflict(ancestor, ours, None)
331
332 assert index.conflicts is not None
333 assert 'conflict.txt' in index.conflicts
334 conflict_ancestor, conflict_ours, conflict_theirs = index.conflicts['conflict.txt']
335 assert conflict_ancestor.id == ancestor_blob_id
336 assert conflict_ancestor.mode == FileMode.BLOB_EXECUTABLE
337 assert conflict_ours.id == ours_blob_id
338 assert conflict_ours.mode == FileMode.BLOB
339 assert conflict_theirs is None

Callers

nothing calls this directly

Calls 3

add_conflictMethod · 0.95
IndexEntryClass · 0.90
IndexClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…