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

Function test_merge_remove_conflicts

test/test_merge.py:148–163  ·  view source on GitHub ↗
(mergerepo: Repository)

Source from the content-addressed store, hash-verified

146
147
148def test_merge_remove_conflicts(mergerepo: Repository) -> None:
149 other_branch_tip = pygit2.Oid(hex='1b2bae55ac95a4be3f8983b86cd579226d0eb247')
150 mergerepo.merge(other_branch_tip)
151 idx = mergerepo.index
152 conflicts = idx.conflicts
153 assert conflicts is not None
154 assert '.gitignore' in conflicts
155 try:
156 conflicts['.gitignore']
157 except KeyError:
158 mergerepo.fail("conflicts['.gitignore'] raised KeyError unexpectedly") # type: ignore
159 del idx.conflicts['.gitignore']
160 with pytest.raises(KeyError):
161 conflicts.__getitem__('.gitignore')
162 assert '.gitignore' not in conflicts
163 assert idx.conflicts is None
164
165
166@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

mergeMethod · 0.80
__getitem__Method · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…