Skip to content

Commit ab27827

Browse files
committed
Fix remaining old Commit_ish annotations in git.refs
(This also improves the sorting of imports where they are already being changed, and fixes a typo in a comment.)
1 parent fe7f9f2 commit ab27827

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

Diff for: git/refs/head.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515

1616
# typing ---------------------------------------------------
1717

18-
from typing import Any, Sequence, Union, TYPE_CHECKING
18+
from typing import Any, Sequence, TYPE_CHECKING, Union
1919

20-
from git.types import PathLike, Old_commit_ish
20+
from git.types import Commit_ish, PathLike
2121

2222
if TYPE_CHECKING:
23-
from git.repo import Repo
2423
from git.objects import Commit
2524
from git.refs import RemoteReference
25+
from git.repo import Repo
2626

2727
# -------------------------------------------------------------------
2828

@@ -62,7 +62,7 @@ def orig_head(self) -> SymbolicReference:
6262

6363
def reset(
6464
self,
65-
commit: Union[Old_commit_ish, SymbolicReference, str] = "HEAD",
65+
commit: Union[Commit_ish, SymbolicReference, str] = "HEAD",
6666
index: bool = True,
6767
working_tree: bool = False,
6868
paths: Union[PathLike, Sequence[PathLike], None] = None,
@@ -99,7 +99,7 @@ def reset(
9999
if index:
100100
mode = "--mixed"
101101

102-
# Tt appears some git versions declare mixed and paths deprecated.
102+
# It appears some git versions declare mixed and paths deprecated.
103103
# See http://github.com/Byron/GitPython/issues#issue/2.
104104
if paths:
105105
mode = None

Diff for: git/refs/reference.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
# This module is part of GitPython and is released under the
22
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
33

4-
from git.util import (
5-
LazyMixin,
6-
IterableObj,
7-
)
4+
from git.util import IterableObj, LazyMixin
85
from .symbolic import SymbolicReference, T_References
96

10-
117
# typing ------------------------------------------------------------------
128

13-
from typing import Any, Callable, Iterator, Type, Union, TYPE_CHECKING
14-
from git.types import Old_commit_ish, PathLike, _T
9+
from typing import Any, Callable, Iterator, TYPE_CHECKING, Type, Union
10+
11+
from git.types import AnyGitObject, PathLike, _T
1512

1613
if TYPE_CHECKING:
1714
from git.repo import Repo
1815

1916
# ------------------------------------------------------------------------------
2017

21-
2218
__all__ = ["Reference"]
2319

2420
# { Utilities
@@ -81,7 +77,7 @@ def __str__(self) -> str:
8177
# @ReservedAssignment
8278
def set_object(
8379
self,
84-
object: Union[Old_commit_ish, "SymbolicReference", str],
80+
object: Union[AnyGitObject, "SymbolicReference", str],
8581
logmsg: Union[str, None] = None,
8682
) -> "Reference":
8783
"""Special version which checks if the head-log needs an update as well.

0 commit comments

Comments
 (0)