|
3 | 3 | #
|
4 | 4 | # This module is part of GitPython and is released under
|
5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php
|
| 6 | +from __future__ import annotations |
6 | 7 | import logging
|
7 | 8 | import os
|
8 | 9 | import re
|
@@ -384,13 +385,13 @@ def create_submodule(self, *args: Any, **kwargs: Any) -> Submodule:
|
384 | 385 | :return: created submodules"""
|
385 | 386 | return Submodule.add(self, *args, **kwargs)
|
386 | 387 |
|
387 |
| - def iter_submodules(self, *args: Any, **kwargs: Any) -> Iterator: |
| 388 | + def iter_submodules(self, *args: Any, **kwargs: Any) -> Iterator[Submodule]: |
388 | 389 | """An iterator yielding Submodule instances, see Traversable interface
|
389 | 390 | for a description of args and kwargs
|
390 | 391 | :return: Iterator"""
|
391 | 392 | return RootModule(self).traverse(*args, **kwargs)
|
392 | 393 |
|
393 |
| - def submodule_update(self, *args: Any, **kwargs: Any) -> Iterator: |
| 394 | + def submodule_update(self, *args: Any, **kwargs: Any) -> Iterator[Submodule]: |
394 | 395 | """Update the submodules, keeping the repository consistent as it will
|
395 | 396 | take the previous state into consideration. For more information, please
|
396 | 397 | see the documentation of RootModule.update"""
|
@@ -774,15 +775,15 @@ def _get_untracked_files(self, *args: Any, **kwargs: Any) -> List[str]:
|
774 | 775 | finalize_process(proc)
|
775 | 776 | return untracked_files
|
776 | 777 |
|
777 |
| - def ignored(self, *paths: PathLike) -> List[PathLike]: |
| 778 | + def ignored(self, *paths: PathLike) -> List[str]: |
778 | 779 | """Checks if paths are ignored via .gitignore
|
779 | 780 | Doing so using the "git check-ignore" method.
|
780 | 781 |
|
781 | 782 | :param paths: List of paths to check whether they are ignored or not
|
782 | 783 | :return: subset of those paths which are ignored
|
783 | 784 | """
|
784 | 785 | try:
|
785 |
| - proc = self.git.check_ignore(*paths) |
| 786 | + proc: str = self.git.check_ignore(*paths) |
786 | 787 | except GitCommandError:
|
787 | 788 | return []
|
788 | 789 | return proc.replace("\\\\", "\\").replace('"', "").split("\n")
|
|
0 commit comments