summaryrefslogtreecommitdiff
path: root/git/objects/base.py
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-31 18:04:28 +0100
committerYobmod <yobmod@gmail.com>2021-07-31 18:04:28 +0100
commit35231dba2f12ef4d19eabc409e72f773a19a3c43 (patch)
tree6ef30f918faad787ec8f93ea8a3a62c0049cf8f7 /git/objects/base.py
parente364c5e327f916366e5936aa2c9f3f4065aec034 (diff)
downloadgitpython-35231dba2f12ef4d19eabc409e72f773a19a3c43.tar.gz
Add type to objects.base.new()
Diffstat (limited to 'git/objects/base.py')
-rw-r--r--git/objects/base.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/git/objects/base.py b/git/objects/base.py
index 64f105ca..a3b0f230 100644
--- a/git/objects/base.py
+++ b/git/objects/base.py
@@ -25,6 +25,7 @@ if TYPE_CHECKING:
from .tree import Tree
from .blob import Blob
from .submodule.base import Submodule
+ from git.refs.reference import Reference
IndexObjUnion = Union['Tree', 'Blob', 'Submodule']
@@ -59,7 +60,7 @@ class Object(LazyMixin):
assert len(binsha) == 20, "Require 20 byte binary sha, got %r, len = %i" % (binsha, len(binsha))
@classmethod
- def new(cls, repo: 'Repo', id): # @ReservedAssignment
+ def new(cls, repo: 'Repo', id: Union[str, 'Reference']) -> Commit_ish:
"""
:return: New Object instance of a type appropriate to the object type behind
id. The id of the newly created object will be a binsha even though