| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,8 +26,13 @@ | |||
| 26 | 26 | ||
| 27 | 27 | Lit_change_type = Literal['A', 'D', 'M', 'R', 'T'] | |
| 28 | 28 | ||
| 29 | + | ||
| 30 | + def is_change_type(inp: str) -> TypeGuard[Lit_change_type]: | ||
| 31 | + return inp in Lit_change_type.__args__ # type: ignore | ||
| 32 | + | ||
| 29 | 33 | # ------------------------------------------------------------------------ | |
| 30 | 34 | ||
| 35 | + | ||
| 31 | 36 | __all__ = ('Diffable', 'DiffIndex', 'Diff', 'NULL_TREE') | |
| 32 | 37 | ||
| 33 | 38 | # Special object to compare against the empty tree in diffs | |
@@ -503,13 +508,10 @@ def _handle_diff_line(lines_bytes: bytes, repo: 'Repo', index: DiffIndex) -> Non | |||
| 503 | 508 | a_blob_id: Union[str, None] | |
| 504 | 509 | b_blob_id: Union[str, None] | |
| 505 | 510 | old_mode, new_mode, a_blob_id, b_blob_id, _change_type = meta.split(None, 4) | |
| 506 | - # Change type can be R100 | ||
| 511 | + # _Change_type can be R100 | ||
| 507 | 512 | # R: status letter | |
| 508 | 513 | # 100: score (in case of copy and rename) | |
| 509 | 514 | ||
| 510 | - def is_change_type(inp: str) -> TypeGuard[Lit_change_type]: | ||
| 511 | - return inp in Lit_change_type.__args__ # type: ignore | ||
| 512 | - | ||
| 513 | 515 | assert is_change_type(_change_type[0]) | |
| 514 | 516 | change_type: Lit_change_type = _change_type[0] | |
| 515 | 517 | score_str = ''.join(_change_type[1:]) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,6 +47,7 @@ | |||
| 47 | 47 | find_first_remote_branch | |
| 48 | 48 | ) | |
| 49 | 49 | ||
| 50 | + from git.repo import Repo | ||
| 50 | 51 | ||
| 51 | 52 | # typing ---------------------------------------------------------------------- | |
| 52 | 53 | from typing import Callable, Dict, Mapping, Sequence, TYPE_CHECKING | |
@@ -55,7 +56,6 @@ | |||
| 55 | 56 | from git.types import Commit_ish, PathLike, TBD | |
| 56 | 57 | ||
| 57 | 58 | if TYPE_CHECKING: | |
| 58 | - from git.repo import Repo | ||
| 59 | 59 | from git.index import IndexFile | |
| 60 | 60 | ||
| 61 | 61 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments