Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

typing fixes - DiffIndex generic type and IndexFile items#1925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 2 commits intogitpython-developers:mainfromAndrej730:main
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletionsgit/diff.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -187,7 +187,7 @@ def diff(
paths: Union[PathLike, List[PathLike], Tuple[PathLike, ...], None] = None,
create_patch: bool = False,
**kwargs: Any,
) -> "DiffIndex":
) -> "DiffIndex[Diff]":
"""Create diffs between two items being trees, trees and index or an index and
the working tree. Detects renames automatically.

Expand DownExpand Up@@ -581,7 +581,7 @@ def _pick_best_path(cls, path_match: bytes, rename_match: bytes, path_fallback_m
return None

@classmethod
def _index_from_patch_format(cls, repo: "Repo", proc: Union["Popen", "Git.AutoInterrupt"]) -> DiffIndex:
def _index_from_patch_format(cls, repo: "Repo", proc: Union["Popen", "Git.AutoInterrupt"]) -> DiffIndex["Diff"]:
"""Create a new :class:`DiffIndex` from the given process output which must be
in patch format.

Expand DownExpand Up@@ -674,7 +674,7 @@ def _index_from_patch_format(cls, repo: "Repo", proc: Union["Popen", "Git.AutoIn
return index

@staticmethod
def _handle_diff_line(lines_bytes: bytes, repo: "Repo", index: DiffIndex) -> None:
def _handle_diff_line(lines_bytes: bytes, repo: "Repo", index: DiffIndex["Diff"]) -> None:
lines = lines_bytes.decode(defenc)

# Discard everything before the first colon, and the colon itself.
Expand DownExpand Up@@ -747,7 +747,7 @@ def _handle_diff_line(lines_bytes: bytes, repo: "Repo", index: DiffIndex) -> Non
index.append(diff)

@classmethod
def _index_from_raw_format(cls, repo: "Repo", proc: "Popen") -> "DiffIndex":
def _index_from_raw_format(cls, repo: "Repo", proc: "Popen") -> "DiffIndex[Diff]":
"""Create a new :class:`DiffIndex` from the given process output which must be
in raw format.

Expand Down
10 changes: 5 additions & 5 deletionsgit/index/base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -658,7 +658,7 @@ def _to_relative_path(self, path: PathLike) -> PathLike:
return os.path.relpath(path, self.repo.working_tree_dir)

def _preprocess_add_items(
self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]]
self, items:Union[PathLike,Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]]]
) -> Tuple[List[PathLike], List[BaseIndexEntry]]:
"""Split the items into two lists of path strings and BaseEntries."""
paths = []
Expand DownExpand Up@@ -749,7 +749,7 @@ def _entries_for_paths(

def add(
self,
items: Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]],
items:Union[PathLike,Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]]],
force: bool = True,
fprogress: Callable = lambda *args: None,
path_rewriter: Union[Callable[..., PathLike], None] = None,
Expand DownExpand Up@@ -976,7 +976,7 @@ def _items_to_rela_paths(
@default_index
def remove(
self,
items: Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]],
items:Union[PathLike,Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]]],
working_tree: bool = False,
**kwargs: Any,
) -> List[str]:
Expand DownExpand Up@@ -1036,7 +1036,7 @@ def remove(
@default_index
def move(
self,
items: Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]],
items:Union[PathLike,Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]]],
skip_errors: bool = False,
**kwargs: Any,
) -> List[Tuple[str, str]]:
Expand DownExpand Up@@ -1478,7 +1478,7 @@ def diff(
paths: Union[PathLike, List[PathLike], Tuple[PathLike, ...], None] = None,
create_patch: bool = False,
**kwargs: Any,
) -> git_diff.DiffIndex:
) -> git_diff.DiffIndex[git_diff.Diff]:
"""Diff this index against the working copy or a :class:`~git.objects.tree.Tree`
or :class:`~git.objects.commit.Commit` object.

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp