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

Function test_branches_with_commit

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

Source from the content-addressed store, hash-verified

132
133
134def test_branches_with_commit(testrepo: Repository) -> None:
135 branches = testrepo.branches.with_commit(EXCLUSIVE_MASTER_COMMIT)
136 assert sorted(branches) == ['master']
137 assert branches.get('i18n') is None
138 assert branches['master'].branch_name == 'master'
139
140 branches = testrepo.branches.with_commit(SHARED_COMMIT)
141 assert sorted(branches) == ['i18n', 'master']
142
143 branches = testrepo.branches.with_commit(LAST_COMMIT)
144 assert sorted(branches) == ['master']
145
146 commit = testrepo[LAST_COMMIT]
147 assert isinstance(commit, Commit)
148 branches = testrepo.branches.with_commit(commit)
149 assert sorted(branches) == ['master']
150
151 branches = testrepo.branches.remote.with_commit(LAST_COMMIT)
152 assert sorted(branches) == []
153
154
155#

Callers

nothing calls this directly

Calls 2

with_commitMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…