| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b9d9e56 commit 04a2753
12 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,7 +80,7 @@ | |||
| 80 | 80 | Union, | |
| 81 | 81 | ) | |
| 82 | 82 | ||
| 83 | - from git.types import Commit_ish, Literal, PathLike | ||
| 83 | + from git.types import Old_commit_ish, Literal, PathLike | ||
| 84 | 84 | ||
| 85 | 85 | if TYPE_CHECKING: | |
| 86 | 86 | from subprocess import Popen | |
@@ -1127,7 +1127,7 @@ def move( | |||
| 1127 | 1127 | def commit( | |
| 1128 | 1128 | self, | |
| 1129 | 1129 | message: str, | |
| 1130 | - parent_commits: Union[Commit_ish, None] = None, | ||
| 1130 | + parent_commits: Union[Old_commit_ish, None] = None, | ||
| 1131 | 1131 | head: bool = True, | |
| 1132 | 1132 | author: Union[None, "Actor"] = None, | |
| 1133 | 1133 | committer: Union[None, "Actor"] = None, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | from typing import Any, TYPE_CHECKING, Union | |
| 18 | 18 | ||
| 19 | - from git.types import PathLike, Commit_ish, Lit_commit_ish | ||
| 19 | + from git.types import PathLike, Old_commit_ish, Lit_old_commit_ish | ||
| 20 | 20 | ||
| 21 | 21 | if TYPE_CHECKING: | |
| 22 | 22 | from git.repo import Repo | |
@@ -53,7 +53,7 @@ class Object(LazyMixin): | |||
| 53 | 53 | * "tag object": https://git-scm.com/docs/gitglossary#def_tag_object | |
| 54 | 54 | ||
| 55 | 55 | :note: | |
| 56 | - See the :class:`~git.types.Commit_ish` union type. | ||
| 56 | + See the :class:`~git.types.Old_commit_ish` union type. | ||
| 57 | 57 | ||
| 58 | 58 | :note: | |
| 59 | 59 | :class:`~git.objects.submodule.base.Submodule` is defined under the hierarchy | |
@@ -77,7 +77,7 @@ class Object(LazyMixin): | |||
| 77 | 77 | ||
| 78 | 78 | __slots__ = ("repo", "binsha", "size") | |
| 79 | 79 | ||
| 80 | - type: Union[Lit_commit_ish, None] = None | ||
| 80 | + type: Union[Lit_old_commit_ish, None] = None | ||
| 81 | 81 | """String identifying (a concrete :class:`Object` subtype for) a git object type. | |
| 82 | 82 | ||
| 83 | 83 | The subtypes that this may name correspond to the kinds of git objects that exist, | |
@@ -90,7 +90,7 @@ class Object(LazyMixin): | |||
| 90 | 90 | ``None`` in concrete leaf subclasses representing specific git object types. | |
| 91 | 91 | ||
| 92 | 92 | :note: | |
| 93 | - See also :class:`~git.types.Commit_ish`. | ||
| 93 | + See also :class:`~git.types.Old_commit_ish`. | ||
| 94 | 94 | """ | |
| 95 | 95 | ||
| 96 | 96 | def __init__(self, repo: "Repo", binsha: bytes): | |
@@ -113,7 +113,7 @@ def __init__(self, repo: "Repo", binsha: bytes): | |||
| 113 | 113 | ) | |
| 114 | 114 | ||
| 115 | 115 | @classmethod | |
| 116 | - def new(cls, repo: "Repo", id: Union[str, "Reference"]) -> Commit_ish: | ||
| 116 | + def new(cls, repo: "Repo", id: Union[str, "Reference"]) -> Old_commit_ish: | ||
| 117 | 117 | """ | |
| 118 | 118 | :return: | |
| 119 | 119 | New :class:`Object` instance of a type appropriate to the object type behind | |
@@ -130,7 +130,7 @@ def new(cls, repo: "Repo", id: Union[str, "Reference"]) -> Commit_ish: | |||
| 130 | 130 | return repo.rev_parse(str(id)) | |
| 131 | 131 | ||
| 132 | 132 | @classmethod | |
| 133 | - def new_from_sha(cls, repo: "Repo", sha1: bytes) -> Commit_ish: | ||
| 133 | + def new_from_sha(cls, repo: "Repo", sha1: bytes) -> Old_commit_ish: | ||
| 134 | 134 | """ | |
| 135 | 135 | :return: | |
| 136 | 136 | New object instance of a type appropriate to represent the given binary sha1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,7 +45,7 @@ | |||
| 45 | 45 | from typing import Callable, Dict, Mapping, Sequence, TYPE_CHECKING, cast | |
| 46 | 46 | from typing import Any, Iterator, Union | |
| 47 | 47 | ||
| 48 | - from git.types import Commit_ish, Literal, PathLike, TBD | ||
| 48 | + from git.types import Old_commit_ish, Literal, PathLike, TBD | ||
| 49 | 49 | ||
| 50 | 50 | if TYPE_CHECKING: | |
| 51 | 51 | from git.index import IndexFile | |
@@ -112,7 +112,7 @@ def __init__( | |||
| 112 | 112 | mode: Union[int, None] = None, | |
| 113 | 113 | path: Union[PathLike, None] = None, | |
| 114 | 114 | name: Union[str, None] = None, | |
| 115 | - parent_commit: Union[Commit_ish, None] = None, | ||
| 115 | + parent_commit: Union[Old_commit_ish, None] = None, | ||
| 116 | 116 | url: Union[str, None] = None, | |
| 117 | 117 | branch_path: Union[PathLike, None] = None, | |
| 118 | 118 | ) -> None: | |
@@ -213,7 +213,7 @@ def __repr__(self) -> str: | |||
| 213 | 213 | ||
| 214 | 214 | @classmethod | |
| 215 | 215 | def _config_parser( | |
| 216 | - cls, repo: "Repo", parent_commit: Union[Commit_ish, None], read_only: bool | ||
| 216 | + cls, repo: "Repo", parent_commit: Union[Old_commit_ish, None], read_only: bool | ||
| 217 | 217 | ) -> SubmoduleConfigParser: | |
| 218 | 218 | """ | |
| 219 | 219 | :return: | |
@@ -264,7 +264,7 @@ def _clear_cache(self) -> None: | |||
| 264 | 264 | # END for each name to delete | |
| 265 | 265 | ||
| 266 | 266 | @classmethod | |
| 267 | - def _sio_modules(cls, parent_commit: Commit_ish) -> BytesIO: | ||
| 267 | + def _sio_modules(cls, parent_commit: Old_commit_ish) -> BytesIO: | ||
| 268 | 268 | """ | |
| 269 | 269 | :return: | |
| 270 | 270 | Configuration file as :class:`~io.BytesIO` - we only access it through the | |
@@ -277,7 +277,7 @@ def _sio_modules(cls, parent_commit: Commit_ish) -> BytesIO: | |||
| 277 | 277 | def _config_parser_constrained(self, read_only: bool) -> SectionConstraint: | |
| 278 | 278 | """:return: Config parser constrained to our submodule in read or write mode""" | |
| 279 | 279 | try: | |
| 280 | - pc: Union["Commit_ish", None] = self.parent_commit | ||
| 280 | + pc: Union["Old_commit_ish", None] = self.parent_commit | ||
| 281 | 281 | except ValueError: | |
| 282 | 282 | pc = None | |
| 283 | 283 | # END handle empty parent repository | |
@@ -1242,7 +1242,7 @@ def remove( | |||
| 1242 | 1242 | ||
| 1243 | 1243 | return self | |
| 1244 | 1244 | ||
| 1245 | - def set_parent_commit(self, commit: Union[Commit_ish, None], check: bool = True) -> "Submodule": | ||
| 1245 | + def set_parent_commit(self, commit: Union[Old_commit_ish, None], check: bool = True) -> "Submodule": | ||
| 1246 | 1246 | """Set this instance to use the given commit whose tree is supposed to | |
| 1247 | 1247 | contain the ``.gitmodules`` blob. | |
| 1248 | 1248 | ||
@@ -1495,7 +1495,7 @@ def url(self) -> str: | |||
| 1495 | 1495 | return self._url | |
| 1496 | 1496 | ||
| 1497 | 1497 | @property | |
| 1498 | - def parent_commit(self) -> "Commit_ish": | ||
| 1498 | + def parent_commit(self) -> "Old_commit_ish": | ||
| 1499 | 1499 | """ | |
| 1500 | 1500 | :return: | |
| 1501 | 1501 | :class:`~git.objects.commit.Commit` instance with the tree containing the | |
@@ -1557,7 +1557,7 @@ def children(self) -> IterableList["Submodule"]: | |||
| 1557 | 1557 | def iter_items( | |
| 1558 | 1558 | cls, | |
| 1559 | 1559 | repo: "Repo", | |
| 1560 | - parent_commit: Union[Commit_ish, str] = "HEAD", | ||
| 1560 | + parent_commit: Union[Old_commit_ish, str] = "HEAD", | ||
| 1561 | 1561 | *Args: Any, | |
| 1562 | 1562 | **kwargs: Any, | |
| 1563 | 1563 | ) -> Iterator["Submodule"]: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | from typing import TYPE_CHECKING, Union | |
| 14 | 14 | ||
| 15 | - from git.types import Commit_ish | ||
| 15 | + from git.types import Old_commit_ish | ||
| 16 | 16 | ||
| 17 | 17 | if TYPE_CHECKING: | |
| 18 | 18 | from git.repo import Repo | |
@@ -77,7 +77,7 @@ def _clear_cache(self) -> None: | |||
| 77 | 77 | ||
| 78 | 78 | def update( # type: ignore[override] | |
| 79 | 79 | self, | |
| 80 | - previous_commit: Union[Commit_ish, None] = None, | ||
| 80 | + previous_commit: Union[Old_commit_ish, None] = None, | ||
| 81 | 81 | recursive: bool = True, | |
| 82 | 82 | force_remove: bool = False, | |
| 83 | 83 | init: bool = True, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | from typing import Any, Sequence, Union, TYPE_CHECKING | |
| 19 | 19 | ||
| 20 | - from git.types import PathLike, Commit_ish | ||
| 20 | + from git.types import PathLike, Old_commit_ish | ||
| 21 | 21 | ||
| 22 | 22 | if TYPE_CHECKING: | |
| 23 | 23 | from git.repo import Repo | |
@@ -62,7 +62,7 @@ def orig_head(self) -> SymbolicReference: | |||
| 62 | 62 | ||
| 63 | 63 | def reset( | |
| 64 | 64 | self, | |
| 65 | - commit: Union[Commit_ish, SymbolicReference, str] = "HEAD", | ||
| 65 | + commit: Union[Old_commit_ish, SymbolicReference, str] = "HEAD", | ||
| 66 | 66 | index: bool = True, | |
| 67 | 67 | working_tree: bool = False, | |
| 68 | 68 | paths: Union[PathLike, Sequence[PathLike], None] = None, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ | |||
| 11 | 11 | # typing ------------------------------------------------------------------ | |
| 12 | 12 | ||
| 13 | 13 | from typing import Any, Callable, Iterator, Type, Union, TYPE_CHECKING | |
| 14 | - from git.types import Commit_ish, PathLike, _T | ||
| 14 | + from git.types import Old_commit_ish, PathLike, _T | ||
| 15 | 15 | ||
| 16 | 16 | if TYPE_CHECKING: | |
| 17 | 17 | from git.repo import Repo | |
@@ -81,7 +81,7 @@ def __str__(self) -> str: | |||
| 81 | 81 | # @ReservedAssignment | |
| 82 | 82 | def set_object( | |
| 83 | 83 | self, | |
| 84 | - object: Union[Commit_ish, "SymbolicReference", str], | ||
| 84 | + object: Union[Old_commit_ish, "SymbolicReference", str], | ||
| 85 | 85 | logmsg: Union[str, None] = None, | |
| 86 | 86 | ) -> "Reference": | |
| 87 | 87 | """Special version which checks if the head-log needs an update as well. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,7 @@ | |||
| 31 | 31 | TYPE_CHECKING, | |
| 32 | 32 | cast, | |
| 33 | 33 | ) | |
| 34 | - from git.types import Commit_ish, PathLike | ||
| 34 | + from git.types import Old_commit_ish, PathLike | ||
| 35 | 35 | ||
| 36 | 36 | if TYPE_CHECKING: | |
| 37 | 37 | from git.repo import Repo | |
@@ -278,7 +278,7 @@ def _get_ref_info(cls, repo: "Repo", ref_path: Union[PathLike, None]) -> Union[T | |||
| 278 | 278 | """ | |
| 279 | 279 | return cls._get_ref_info_helper(repo, ref_path) | |
| 280 | 280 | ||
| 281 | - def _get_object(self) -> Commit_ish: | ||
| 281 | + def _get_object(self) -> Old_commit_ish: | ||
| 282 | 282 | """ | |
| 283 | 283 | :return: | |
| 284 | 284 | The object our ref currently refers to. Refs can be cached, they will always | |
@@ -345,7 +345,7 @@ def set_commit( | |||
| 345 | 345 | ||
| 346 | 346 | def set_object( | |
| 347 | 347 | self, | |
| 348 | - object: Union[Commit_ish, "SymbolicReference", str], | ||
| 348 | + object: Union[Old_commit_ish, "SymbolicReference", str], | ||
| 349 | 349 | logmsg: Union[str, None] = None, | |
| 350 | 350 | ) -> "SymbolicReference": | |
| 351 | 351 | """Set the object we point to, possibly dereference our symbolic reference | |
@@ -404,7 +404,7 @@ def _get_reference(self) -> "SymbolicReference": | |||
| 404 | 404 | ||
| 405 | 405 | def set_reference( | |
| 406 | 406 | self, | |
| 407 | - ref: Union[Commit_ish, "SymbolicReference", str], | ||
| 407 | + ref: Union[Old_commit_ish, "SymbolicReference", str], | ||
| 408 | 408 | logmsg: Union[str, None] = None, | |
| 409 | 409 | ) -> "SymbolicReference": | |
| 410 | 410 | """Set ourselves to the given `ref`. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,7 @@ | |||
| 15 | 15 | # typing ------------------------------------------------------------------ | |
| 16 | 16 | ||
| 17 | 17 | from typing import Any, Type, Union, TYPE_CHECKING | |
| 18 | - from git.types import Commit_ish, PathLike | ||
| 18 | + from git.types import Old_commit_ish, PathLike | ||
| 19 | 19 | ||
| 20 | 20 | if TYPE_CHECKING: | |
| 21 | 21 | from git.repo import Repo | |
@@ -82,7 +82,7 @@ def tag(self) -> Union["TagObject", None]: | |||
| 82 | 82 | ||
| 83 | 83 | # Make object read-only. It should be reasonably hard to adjust an existing tag. | |
| 84 | 84 | @property | |
| 85 | - def object(self) -> Commit_ish: # type: ignore[override] | ||
| 85 | + def object(self) -> Old_commit_ish: # type: ignore[override] | ||
| 86 | 86 | return Reference._get_object(self) | |
| 87 | 87 | ||
| 88 | 88 | @classmethod | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,7 @@ | |||
| 41 | 41 | overload, | |
| 42 | 42 | ) | |
| 43 | 43 | ||
| 44 | - from git.types import PathLike, Literal, Commit_ish | ||
| 44 | + from git.types import PathLike, Literal, Old_commit_ish | ||
| 45 | 45 | ||
| 46 | 46 | if TYPE_CHECKING: | |
| 47 | 47 | from git.repo.base import Repo | |
@@ -196,7 +196,7 @@ def __init__( | |||
| 196 | 196 | self.summary = summary | |
| 197 | 197 | ||
| 198 | 198 | @property | |
| 199 | - def old_commit(self) -> Union[str, SymbolicReference, Commit_ish, None]: | ||
| 199 | + def old_commit(self) -> Union[str, SymbolicReference, Old_commit_ish, None]: | ||
| 200 | 200 | return self._old_commit_sha and self._remote.repo.commit(self._old_commit_sha) or None | |
| 201 | 201 | ||
| 202 | 202 | @property | |
@@ -362,7 +362,7 @@ def __init__( | |||
| 362 | 362 | ref: SymbolicReference, | |
| 363 | 363 | flags: int, | |
| 364 | 364 | note: str = "", | |
| 365 | - old_commit: Union[Commit_ish, None] = None, | ||
| 365 | + old_commit: Union[Old_commit_ish, None] = None, | ||
| 366 | 366 | remote_ref_path: Optional[PathLike] = None, | |
| 367 | 367 | ) -> None: | |
| 368 | 368 | """Initialize a new instance.""" | |
@@ -381,7 +381,7 @@ def name(self) -> str: | |||
| 381 | 381 | return self.ref.name | |
| 382 | 382 | ||
| 383 | 383 | @property | |
| 384 | - def commit(self) -> Commit_ish: | ||
| 384 | + def commit(self) -> Old_commit_ish: | ||
| 385 | 385 | """:return: Commit of our remote ref""" | |
| 386 | 386 | return self.ref.commit | |
| 387 | 387 | ||
@@ -438,7 +438,7 @@ def _from_line(cls, repo: "Repo", line: str, fetch_line: str) -> "FetchInfo": | |||
| 438 | 438 | ||
| 439 | 439 | # Parse operation string for more info. | |
| 440 | 440 | # This makes no sense for symbolic refs, but we parse it anyway. | |
| 441 | - old_commit: Union[Commit_ish, None] = None | ||
| 441 | + old_commit: Union[Old_commit_ish, None] = None | ||
| 442 | 442 | is_tag_operation = False | |
| 443 | 443 | if "rejected" in operation: | |
| 444 | 444 | flags |= cls.REJECTED | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,7 +55,7 @@ | |||
| 55 | 55 | TBD, | |
| 56 | 56 | PathLike, | |
| 57 | 57 | Lit_config_levels, | |
| 58 | - Commit_ish, | ||
| 58 | + Old_commit_ish, | ||
| 59 | 59 | CallableProgress, | |
| 60 | 60 | Tree_ish, | |
| 61 | 61 | assert_never, | |
@@ -696,7 +696,7 @@ def config_writer(self, config_level: Lit_config_levels = "repository") -> GitCo | |||
| 696 | 696 | """ | |
| 697 | 697 | return GitConfigParser(self._get_config_path(config_level), read_only=False, repo=self, merge_includes=False) | |
| 698 | 698 | ||
| 699 | - def commit(self, rev: Union[str, Commit_ish, None] = None) -> Commit: | ||
| 699 | + def commit(self, rev: Union[str, Old_commit_ish, None] = None) -> Commit: | ||
| 700 | 700 | """The :class:`~git.objects.commit.Commit` object for the specified revision. | |
| 701 | 701 | ||
| 702 | 702 | :param rev: | |
@@ -772,7 +772,7 @@ def iter_commits( | |||
| 772 | 772 | ||
| 773 | 773 | return Commit.iter_items(self, rev, paths, **kwargs) | |
| 774 | 774 | ||
| 775 | - def merge_base(self, *rev: TBD, **kwargs: Any) -> List[Union[Commit_ish, None]]: | ||
| 775 | + def merge_base(self, *rev: TBD, **kwargs: Any) -> List[Union[Old_commit_ish, None]]: | ||
| 776 | 776 | R"""Find the closest common ancestor for the given revision | |
| 777 | 777 | (:class:`~git.objects.commit.Commit`\s, :class:`~git.refs.tag.Tag`\s, | |
| 778 | 778 | :class:`~git.refs.reference.Reference`\s, etc.). | |
@@ -797,7 +797,7 @@ def merge_base(self, *rev: TBD, **kwargs: Any) -> List[Union[Commit_ish, None]]: | |||
| 797 | 797 | raise ValueError("Please specify at least two revs, got only %i" % len(rev)) | |
| 798 | 798 | # END handle input | |
| 799 | 799 | ||
| 800 | - res: List[Union[Commit_ish, None]] = [] | ||
| 800 | + res: List[Union[Old_commit_ish, None]] = [] | ||
| 801 | 801 | try: | |
| 802 | 802 | lines = self.git.merge_base(*rev, **kwargs).splitlines() # List[str] | |
| 803 | 803 | except GitCommandError as err: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments