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

Function test_cherrypick_remove_conflicts

test/test_cherrypick.py:60–81  ·  view source on GitHub ↗
(mergerepo: Repository)

Source from the content-addressed store, hash-verified

58
59
60def test_cherrypick_remove_conflicts(mergerepo: Repository) -> None:
61 assert mergerepo.state() == RepositoryState.NONE
62 assert not mergerepo.message
63
64 other_branch_tip = '1b2bae55ac95a4be3f8983b86cd579226d0eb247'
65 mergerepo.cherrypick(other_branch_tip)
66
67 assert mergerepo.state() == RepositoryState.CHERRYPICK
68 assert mergerepo.message.startswith('commit to provoke a conflict')
69
70 idx = mergerepo.index
71 conflicts = idx.conflicts
72 assert conflicts is not None
73 conflicts['.gitignore']
74 del idx.conflicts['.gitignore']
75 with pytest.raises(KeyError):
76 conflicts.__getitem__('.gitignore')
77 assert idx.conflicts is None
78
79 mergerepo.state_cleanup()
80 assert mergerepo.state() == RepositoryState.NONE
81 assert not mergerepo.message

Callers

nothing calls this directly

Calls 3

stateMethod · 0.80
state_cleanupMethod · 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…