summaryrefslogtreecommitdiff
path: root/git/refs/head.py
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2021-07-02 07:54:45 +0800
committerGitHub <noreply@github.com>2021-07-02 07:54:45 +0800
commit18c777bf815357663226fd6834c8b1bcfe9b7b62 (patch)
tree6e60335c9c631c38d0e88cf0ac11623985b8bd36 /git/refs/head.py
parent8ad4f5923e7df65a4ad30a527ab10abc88f74f64 (diff)
parentd4a9eab9ddc64a18b33ac04a4224f347ccdc78de (diff)
downloadgitpython-18c777bf815357663226fd6834c8b1bcfe9b7b62.tar.gz
Merge pull request #1282 from Yobmod/main
Start adding types to Submodule, add py.typed to manifest
Diffstat (limited to 'git/refs/head.py')
-rw-r--r--git/refs/head.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/git/refs/head.py b/git/refs/head.py
index cc838590..c698004d 100644
--- a/git/refs/head.py
+++ b/git/refs/head.py
@@ -5,6 +5,9 @@ from git.exc import GitCommandError
from .symbolic import SymbolicReference
from .reference import Reference
+from typing import Union
+from git.types import Commit_ish
+
__all__ = ["HEAD", "Head"]
@@ -12,7 +15,7 @@ def strip_quotes(string):
if string.startswith('"') and string.endswith('"'):
return string[1:-1]
return string
-
+
class HEAD(SymbolicReference):
@@ -33,7 +36,7 @@ class HEAD(SymbolicReference):
to contain the previous value of HEAD"""
return SymbolicReference(self.repo, self._ORIG_HEAD_NAME)
- def reset(self, commit='HEAD', index=True, working_tree=False,
+ def reset(self, commit: Union[Commit_ish, SymbolicReference, str] = 'HEAD', index=True, working_tree=False,
paths=None, **kwargs):
"""Reset our HEAD to the given commit optionally synchronizing
the index and working tree. The reference we refer to will be set to
@@ -60,6 +63,7 @@ class HEAD(SymbolicReference):
Additional arguments passed to git-reset.
:return: self"""
+ mode: Union[str, None]
mode = "--soft"
if index:
mode = "--mixed"