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

Method _valid

pygit2/branches.py:92–102  ·  view source on GitHub ↗
(self, branch: Branch)

Source from the content-addressed store, hash-verified

90 self[name].delete()
91
92 def _valid(self, branch: Branch) -> bool:
93 if branch.type == ReferenceType.SYMBOLIC:
94 branch_direct = branch.resolve()
95 else:
96 branch_direct = branch
97
98 return (
99 self._commit is None
100 or branch_direct.target == self._commit
101 or self._repository.descendant_of(branch_direct.target, self._commit)
102 )
103
104 def with_commit(self, commit: Commit | Oid | str | None) -> 'Branches':
105 assert self._commit is None

Callers 1

__getitem__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected