(self, branch: Branch)
| 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 |