| 60 | self.remote = Branches(repository, flag=BranchType.REMOTE, commit=commit) |
| 61 | |
| 62 | def __getitem__(self, name: str) -> Branch: |
| 63 | branch = None |
| 64 | if self._flag & BranchType.LOCAL: |
| 65 | branch = self._repository.lookup_branch(name, BranchType.LOCAL) |
| 66 | |
| 67 | if branch is None and self._flag & BranchType.REMOTE: |
| 68 | branch = self._repository.lookup_branch(name, BranchType.REMOTE) |
| 69 | |
| 70 | if branch is None or not self._valid(branch): |
| 71 | raise KeyError(f'Branch not found: {name}') |
| 72 | |
| 73 | return branch |
| 74 | |
| 75 | def get(self, key: str) -> Branch: |
| 76 | try: |