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

Function test_branches_create

test/test_branch.py:59–73  ·  view source on GitHub ↗
(testrepo: Repository)

Source from the content-addressed store, hash-verified

57
58
59def test_branches_create(testrepo: Repository) -> None:
60 commit = testrepo[LAST_COMMIT]
61 assert isinstance(commit, Commit)
62 reference = testrepo.branches.create('version1', commit)
63 assert 'version1' in testrepo.branches
64 reference = testrepo.branches['version1']
65 assert reference.target == LAST_COMMIT
66
67 # try to create existing reference
68 with pytest.raises(ValueError):
69 testrepo.branches.create('version1', commit)
70
71 # try to create existing reference with force
72 reference = testrepo.branches.create('version1', commit, True)
73 assert reference.target == LAST_COMMIT
74
75
76def test_branches_delete(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 1

createMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…