diff options
Diffstat (limited to 'git/refs')
| -rw-r--r-- | git/refs/head.py | 8 | ||||
| -rw-r--r-- | git/refs/symbolic.py | 4 |
2 files changed, 8 insertions, 4 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" diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index 64a6591a..ca0691d9 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -1,7 +1,8 @@ import os from git.compat import defenc -from git.objects import Object, Commit +from git.objects import Object +from git.objects.commit import Commit from git.util import ( join_path, join_path_native, @@ -19,7 +20,6 @@ import os.path as osp from .log import RefLog - __all__ = ["SymbolicReference"] |
