Skip to content

Commit

Permalink
Fix IndexFile items argument type
Browse files Browse the repository at this point in the history
Error before commit:

path: os.PathLike = ...
repo = git.Repo(path_dir)
repo.index.add(path)
  • Loading branch information
Andrej730 committed Jun 2, 2024
1 parent 1e1a858 commit 59a0c88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions git/index/base.py
Original file line number Diff line number Diff 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 Down Expand 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 Down Expand 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 Down Expand 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 Down

0 comments on commit 59a0c88

Please sign in to comment.