diff options
author | Yobmod <yobmod@gmail.com> | 2021-07-05 14:32:57 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-07-05 14:32:57 +0100 |
commit | 41e9781b640983cd3f38223e5b349eb299a0e4f6 (patch) | |
tree | 5aa708d909fed92bb8c3a9c98e5d9e1cdc790ddf /git/repo/base.py | |
parent | 53f1195b7e279a0a3d783dff3b4ec68b47261d96 (diff) | |
download | gitpython-41e9781b640983cd3f38223e5b349eb299a0e4f6.tar.gz |
Improve BlameEntry.commit typing
Diffstat (limited to 'git/repo/base.py')
-rw-r--r-- | git/repo/base.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git/repo/base.py b/git/repo/base.py index e60b6f6c..e1b1fc76 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -36,7 +36,7 @@ import gitdb # typing ------------------------------------------------------ -from git.types import ConfigLevels_NT, TBD, PathLike, Lit_config_levels, Commit_ish, Tree_ish +from git.types import TBD, PathLike, Lit_config_levels, Commit_ish, Tree_ish from typing import (Any, BinaryIO, Callable, Dict, Iterator, List, Mapping, Optional, Sequence, TextIO, Tuple, Type, Union, @@ -58,7 +58,7 @@ __all__ = ('Repo',) class BlameEntry(NamedTuple): - commit: Dict[str, TBD] + commit: Dict[str, 'Commit'] linenos: range orig_path: Optional[str] orig_linenos: range @@ -96,7 +96,7 @@ class Repo(object): # invariants # represents the configuration level of a configuration file - config_level: ConfigLevels_Tup = ConfigLevels_NT("system", "user", "global", "repository") + config_level: ConfigLevels_Tup = ("system", "user", "global", "repository") # Subclass configuration # Subclasses may easily bring in their own custom types by placing a constructor or type here @@ -802,7 +802,7 @@ class Repo(object): should get a continuous range spanning all line numbers in the file. """ data = self.git.blame(rev, '--', file, p=True, incremental=True, stdout_as_string=False, **kwargs) - commits = {} # type: Dict[str, TBD] + commits: Dict[str, Commit] = {} stream = (line for line in data.split(b'\n') if line) while True: |