| 41 | remote: 'Branches' |
| 42 | |
| 43 | def __init__( |
| 44 | self, |
| 45 | repository: BaseRepository, |
| 46 | flag: BranchType = BranchType.ALL, |
| 47 | commit: Commit | Oid | str | None = None, |
| 48 | ) -> None: |
| 49 | self._repository = repository |
| 50 | self._flag = flag |
| 51 | if commit is not None: |
| 52 | if isinstance(commit, Commit): |
| 53 | commit = commit.id |
| 54 | elif not isinstance(commit, Oid): |
| 55 | commit = self._repository.expand_id(commit) |
| 56 | self._commit = commit |
| 57 | |
| 58 | if flag == BranchType.ALL: |
| 59 | self.local = Branches(repository, flag=BranchType.LOCAL, commit=commit) |
| 60 | self.remote = Branches(repository, flag=BranchType.REMOTE, commit=commit) |
| 61 | |
| 62 | def __getitem__(self, name: str) -> Branch: |
| 63 | branch = None |