Skip to content

Commit 59a0c88

Browse files
committed
Fix IndexFile items argument type
Error before commit: path: os.PathLike = ... repo = git.Repo(path_dir) repo.index.add(path)
1 parent 1e1a858 commit 59a0c88

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

git/index/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ def _to_relative_path(self, path: PathLike) -> PathLike:
658658
return os.path.relpath(path, self.repo.working_tree_dir)
659659

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

750750
def add(
751751
self,
752-
items: Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]],
752+
items: Union[PathLike, Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]]],
753753
force: bool = True,
754754
fprogress: Callable = lambda *args: None,
755755
path_rewriter: Union[Callable[..., PathLike], None] = None,
@@ -976,7 +976,7 @@ def _items_to_rela_paths(
976976
@default_index
977977
def remove(
978978
self,
979-
items: Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]],
979+
items: Union[PathLike, Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]]],
980980
working_tree: bool = False,
981981
**kwargs: Any,
982982
) -> List[str]:
@@ -1036,7 +1036,7 @@ def remove(
10361036
@default_index
10371037
def move(
10381038
self,
1039-
items: Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]],
1039+
items: Union[PathLike, Sequence[Union[PathLike, Blob, BaseIndexEntry, "Submodule"]]],
10401040
skip_errors: bool = False,
10411041
**kwargs: Any,
10421042
) -> List[Tuple[str, str]]:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy