summaryrefslogtreecommitdiff
path: root/git/repo/base.py
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-03-16 22:08:20 +0000
committerYobmod <yobmod@gmail.com>2021-03-16 22:08:20 +0000
commit5232c89de10872a6df6227c5dcea169bd1aa6550 (patch)
treedc23db6e4a360c9a36321050bed7d5f445b4922f /git/repo/base.py
parent9562ae2e2436e052d31c40d5f9d3d0318f6c4575 (diff)
downloadgitpython-5232c89de10872a6df6227c5dcea169bd1aa6550.tar.gz
add types to git.__init__, compat, db, diff, exc, util
Diffstat (limited to 'git/repo/base.py')
-rw-r--r--git/repo/base.py24
1 files changed, 8 insertions, 16 deletions
diff --git a/git/repo/base.py b/git/repo/base.py
index 99e87643..211d2657 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -36,18 +36,9 @@ import gitdb
from git.types import TBD, PathLike
from typing_extensions import Literal
-from typing import (Any,
- BinaryIO,
- Callable,
- Dict,
- Iterator,
- List,
- Mapping,
- Optional,
- TextIO,
- Tuple,
- Type,
- Union,
+from typing import (Any, BinaryIO, Callable, Dict,
+ Iterator, List, Mapping, Optional,
+ TextIO, Tuple, Type, Union,
NamedTuple, cast, TYPE_CHECKING)
if TYPE_CHECKING: # only needed for types
@@ -231,10 +222,11 @@ class Repo(object):
self.git = self.GitCommandWrapperType(self.working_dir)
# special handling, in special times
- args = [osp.join(self.common_dir, 'objects')]
+ rootpath = osp.join(self.common_dir, 'objects')
if issubclass(odbt, GitCmdObjectDB):
- args.append(self.git)
- self.odb = odbt(*args)
+ self.odb = odbt(rootpath, self.git)
+ else:
+ self.odb = odbt(rootpath)
def __enter__(self) -> 'Repo':
return self
@@ -514,7 +506,7 @@ class Repo(object):
return GitConfigParser(self._get_config_path(config_level), read_only=False, repo=self)
def commit(self, rev: Optional[TBD] = None
- ) -> Union['SymbolicReference', Commit, 'TagObject', 'Blob', 'Tree', None]:
+ ) -> Union['SymbolicReference', Commit, 'TagObject', 'Blob', 'Tree']:
"""The Commit object for the specified revision
:param rev: revision specifier, see git-rev-parse for viable options.