| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,7 +187,7 @@ def diff( | |||
| 187 | 187 | paths: Union[PathLike, List[PathLike], Tuple[PathLike, ...], None] = None, | |
| 188 | 188 | create_patch: bool = False, | |
| 189 | 189 | **kwargs: Any, | |
| 190 | - ) -> "DiffIndex": | ||
| 190 | + ) -> "DiffIndex[Diff]": | ||
| 191 | 191 | """Create diffs between two items being trees, trees and index or an index and | |
| 192 | 192 | the working tree. Detects renames automatically. | |
| 193 | 193 | ||
@@ -581,7 +581,7 @@ def _pick_best_path(cls, path_match: bytes, rename_match: bytes, path_fallback_m | |||
| 581 | 581 | return None | |
| 582 | 582 | ||
| 583 | 583 | @classmethod | |
| 584 | - def _index_from_patch_format(cls, repo: "Repo", proc: Union["Popen", "Git.AutoInterrupt"]) -> DiffIndex: | ||
| 584 | + def _index_from_patch_format(cls, repo: "Repo", proc: Union["Popen", "Git.AutoInterrupt"]) -> DiffIndex["Diff"]: | ||
| 585 | 585 | """Create a new :class:`DiffIndex` from the given process output which must be | |
| 586 | 586 | in patch format. | |
| 587 | 587 | ||
@@ -674,7 +674,7 @@ def _index_from_patch_format(cls, repo: "Repo", proc: Union["Popen", "Git.AutoIn | |||
| 674 | 674 | return index | |
| 675 | 675 | ||
| 676 | 676 | @staticmethod | |
| 677 | - def _handle_diff_line(lines_bytes: bytes, repo: "Repo", index: DiffIndex) -> None: | ||
| 677 | + def _handle_diff_line(lines_bytes: bytes, repo: "Repo", index: DiffIndex["Diff"]) -> None: | ||
| 678 | 678 | lines = lines_bytes.decode(defenc) | |
| 679 | 679 | ||
| 680 | 680 | # Discard everything before the first colon, and the colon itself. | |
@@ -747,7 +747,7 @@ def _handle_diff_line(lines_bytes: bytes, repo: "Repo", index: DiffIndex) -> Non | |||
| 747 | 747 | index.append(diff) | |
| 748 | 748 | ||
| 749 | 749 | @classmethod | |
| 750 | - def _index_from_raw_format(cls, repo: "Repo", proc: "Popen") -> "DiffIndex": | ||
| 750 | + def _index_from_raw_format(cls, repo: "Repo", proc: "Popen") -> "DiffIndex[Diff]": | ||
| 751 | 751 | """Create a new :class:`DiffIndex` from the given process output which must be | |
| 752 | 752 | in raw format. | |
| 753 | 753 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -658,7 +658,7 @@ def _to_relative_path(self, path: PathLike) -> PathLike: | |||
| 658 | 658 | return os.path.relpath(path, self.repo.working_tree_dir) | |
| 659 | 659 | ||
| 660 | 660 | def _preprocess_add_items( | |
| 661 | - self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]] | ||
| 661 | + self, items: Union[PathLike, Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]]] | ||
| 662 | 662 | ) -> Tuple[List[PathLike], List[BaseIndexEntry]]: | |
| 663 | 663 | """Split the items into two lists of path strings and BaseEntries.""" | |
| 664 | 664 | paths = [] | |
@@ -749,7 +749,7 @@ def _entries_for_paths( | |||
| 749 | 749 | ||
| 750 | 750 | def add( | |
| 751 | 751 | self, | |
| 752 | - items: Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]], | ||
| 752 | + items: Union[PathLike, Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]]], | ||
| 753 | 753 | force: bool = True, | |
| 754 | 754 | fprogress: Callable = lambda *args: None, | |
| 755 | 755 | path_rewriter: Union[Callable[..., PathLike], None] = None, | |
@@ -976,7 +976,7 @@ def _items_to_rela_paths( | |||
| 976 | 976 | @default_index | |
| 977 | 977 | def remove( | |
| 978 | 978 | self, | |
| 979 | - items: Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]], | ||
| 979 | + items: Union[PathLike, Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]]], | ||
| 980 | 980 | working_tree: bool = False, | |
| 981 | 981 | **kwargs: Any, | |
| 982 | 982 | ) -> List[str]: | |
@@ -1036,7 +1036,7 @@ def remove( | |||
| 1036 | 1036 | @default_index | |
| 1037 | 1037 | def move( | |
| 1038 | 1038 | self, | |
| 1039 | - items: Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]], | ||
| 1039 | + items: Union[PathLike, Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]]], | ||
| 1040 | 1040 | skip_errors: bool = False, | |
| 1041 | 1041 | **kwargs: Any, | |
| 1042 | 1042 | ) -> List[Tuple[str, str]]: | |
@@ -1478,7 +1478,7 @@ def diff( | |||
| 1478 | 1478 | paths: Union[PathLike, List[PathLike], Tuple[PathLike, ...], None] = None, | |
| 1479 | 1479 | create_patch: bool = False, | |
| 1480 | 1480 | **kwargs: Any, | |
| 1481 | - ) -> git_diff.DiffIndex: | ||
| 1481 | + ) -> git_diff.DiffIndex[git_diff.Diff]: | ||
| 1482 | 1482 | """Diff this index against the working copy or a :class:`~git.objects.tree.Tree` | |
| 1483 | 1483 | or :class:`~git.objects.commit.Commit` object. | |
| 1484 | 1484 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments