summaryrefslogtreecommitdiff
path: root/git/index/fun.py
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-19 19:10:45 +0100
committerYobmod <yobmod@gmail.com>2021-07-19 19:10:45 +0100
commit9e5e969479ec6018e1ba06b95bcdefca5b0082a4 (patch)
tree574e03c6c4acd1067e3b285974651ec9e9529a49 /git/index/fun.py
parent9a587e14d509cc77bf47b9591d1def3e5a1df570 (diff)
downloadgitpython-9e5e969479ec6018e1ba06b95bcdefca5b0082a4.tar.gz
Change remaining type comments to py3.6+ types
Diffstat (limited to 'git/index/fun.py')
-rw-r--r--git/index/fun.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/git/index/fun.py b/git/index/fun.py
index e5e566a0..e071e15c 100644
--- a/git/index/fun.py
+++ b/git/index/fun.py
@@ -99,8 +99,8 @@ def run_commit_hook(name: str, index: 'IndexFile', *args: str) -> None:
except Exception as ex:
raise HookExecutionError(hp, ex) from ex
else:
- stdout_list = [] # type: List[str]
- stderr_list = [] # type: List[str]
+ stdout_list: List[str] = []
+ stderr_list: List[str] = []
handle_process_output(cmd, stdout_list.append, stderr_list.append, finalize_process)
stdout = ''.join(stdout_list)
stderr = ''.join(stderr_list)
@@ -151,8 +151,8 @@ def write_cache(entries: Sequence[Union[BaseIndexEntry, 'IndexEntry']], stream:
beginoffset = tell()
write(entry[4]) # ctime
write(entry[5]) # mtime
- path_str = entry[3] # type: str
- path = force_bytes(path_str, encoding=defenc)
+ path_str: str = entry[3]
+ path: bytes = force_bytes(path_str, encoding=defenc)
plen = len(path) & CE_NAMEMASK # path length
assert plen == len(path), "Path %s too long to fit into index" % entry[3]
flags = plen | (entry[2] & CE_NAMEMASK_INV) # clear possible previous values
@@ -210,7 +210,7 @@ def read_cache(stream: IO[bytes]) -> Tuple[int, Dict[Tuple[PathLike, int], 'Inde
* content_sha is a 20 byte sha on all cache file contents"""
version, num_entries = read_header(stream)
count = 0
- entries = {} # type: Dict[Tuple[PathLike, int], 'IndexEntry']
+ entries: Dict[Tuple[PathLike, int], 'IndexEntry'] = {}
read = stream.read
tell = stream.tell