summaryrefslogtreecommitdiff
path: root/git/refs/head.py
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2021-07-11 12:30:59 +0800
committerGitHub <noreply@github.com>2021-07-11 12:30:59 +0800
commit9523033fd1ff499ae3d151b23b851b7e2b64bf75 (patch)
treec2f7b467186269926c48c4b2cf02d8364dc39751 /git/refs/head.py
parent0a6d9d669979cc5a89ca73f8f4843cba47b4486a (diff)
parent94c66525a6e7d5c74a9aee65d14630bb674439f7 (diff)
downloadgitpython-9523033fd1ff499ae3d151b23b851b7e2b64bf75.tar.gz
Merge pull request #1285 from Yobmod/main
Finish initial typing of Index and Submodule
Diffstat (limited to 'git/refs/head.py')
-rw-r--r--git/refs/head.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/git/refs/head.py b/git/refs/head.py
index c698004d..97c8e6a1 100644
--- a/git/refs/head.py
+++ b/git/refs/head.py
@@ -5,9 +5,13 @@ from git.exc import GitCommandError
from .symbolic import SymbolicReference
from .reference import Reference
-from typing import Union
+from typing import Union, TYPE_CHECKING
+
from git.types import Commit_ish
+if TYPE_CHECKING:
+ from git.repo import Repo
+
__all__ = ["HEAD", "Head"]
@@ -25,12 +29,13 @@ class HEAD(SymbolicReference):
_ORIG_HEAD_NAME = 'ORIG_HEAD'
__slots__ = ()
- def __init__(self, repo, path=_HEAD_NAME):
+ def __init__(self, repo: 'Repo', path=_HEAD_NAME):
if path != self._HEAD_NAME:
raise ValueError("HEAD instance must point to %r, got %r" % (self._HEAD_NAME, path))
super(HEAD, self).__init__(repo, path)
+ self.commit: 'Commit_ish'
- def orig_head(self):
+ def orig_head(self) -> 'SymbolicReference':
"""
:return: SymbolicReference pointing at the ORIG_HEAD, which is maintained
to contain the previous value of HEAD"""