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

Function test_cherrypick_already_something_in_index

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

Source from the content-addressed store, hash-verified

46
47
48def test_cherrypick_already_something_in_index(mergerepo: Repository) -> None:
49 branch_head_hex = '03490f16b15a09913edb3a067a3dc67fbb8d41f1'
50 branch_object = mergerepo.get(branch_head_hex)
51 assert branch_object is not None
52 branch_oid = branch_object.id
53 with (Path(mergerepo.workdir) / 'inindex.txt').open('w') as f:
54 f.write('new content')
55 mergerepo.index.add('inindex.txt')
56 with pytest.raises(pygit2.GitError):
57 mergerepo.cherrypick(branch_oid)
58
59
60def test_cherrypick_remove_conflicts(mergerepo: Repository) -> None:

Callers

nothing calls this directly

Calls 4

openMethod · 0.80
getMethod · 0.45
writeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…