summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-04-01 15:28:02 +0100
committerSebastian Thiel <sebastian.thiel@icloud.com>2022-04-02 07:51:51 +0800
commit0b33576f8e7add5671f8927dff228e7f92eec076 (patch)
tree22b457c74a6b2072c51e6bf746ae97b0fd477d14
parentb85c2594f31179e135af893d82868e7742464fe6 (diff)
downloadgitpython-0b33576f8e7add5671f8927dff228e7f92eec076.tar.gz
Allow `repo.create_head`'s `commit` arg to be a `SymbolicReference`
This matches the signature from `Head.create`.
-rw-r--r--git/repo/base.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/git/repo/base.py b/git/repo/base.py
index 510eb12b..f8bc8128 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -420,7 +420,8 @@ class Repo(object):
else:
return TagReference._common_path_default + '/' + path_str
- def create_head(self, path: PathLike, commit: str = 'HEAD',
+ def create_head(self, path: PathLike,
+ commit: Union['SymbolicReference', 'str'] = 'HEAD',
force: bool = False, logmsg: Optional[str] = None
) -> 'Head':
"""Create a new head within the repository.