| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,15 +47,15 @@ | |||
| 47 | 47 | find_first_remote_branch | |
| 48 | 48 | ) | |
| 49 | 49 | ||
| 50 | - from git.repo import Repo | ||
| 51 | 50 | ||
| 52 | 51 | # typing ---------------------------------------------------------------------- | |
| 53 | - from typing import Callable, Dict, Mapping, Sequence, TYPE_CHECKING | ||
| 52 | + from typing import Callable, Dict, Mapping, Sequence, TYPE_CHECKING, cast | ||
| 54 | 53 | from typing import Any, Iterator, Union | |
| 55 | 54 | ||
| 56 | 55 | from git.types import Commit_ish, PathLike, TBD | |
| 57 | 56 | ||
| 58 | 57 | if TYPE_CHECKING: | |
| 58 | + from git.repo import Repo | ||
| 59 | 59 | from git.index import IndexFile | |
| 60 | 60 | ||
| 61 | 61 | ||
@@ -589,7 +589,8 @@ def update(self, recursive: bool = False, init: bool = True, to_latest_revision: | |||
| 589 | 589 | if not dry_run: | |
| 590 | 590 | # see whether we have a valid branch to checkout | |
| 591 | 591 | try: | |
| 592 | - assert isinstance(mrepo, Repo) | ||
| 592 | + # assert isinstance(mrepo, Repo) # cant do this cos of circular import | ||
| 593 | + mrepo = cast('Repo', mrepo) # Try TypeGuard wirh hasattr? | ||
| 593 | 594 | # find a remote which has our branch - we try to be flexible | |
| 594 | 595 | remote_branch = find_first_remote_branch(mrepo.remotes, self.branch_name) | |
| 595 | 596 | local_branch = mkhead(mrepo, self.branch_path) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments