Various style improvements by EliahKagan · Pull Request #2049 · gitpython-developers/GitPython
def is_unmerged_blob(t: Tuple[StageType, Blob]) -> bool: return t[0] != 0
path_map: Dict[PathLike, List[Tuple[StageType, Blob]]] = {} for stage, blob in self.iter_blobs(is_unmerged_blob): path_map.setdefault(blob.path, []).append((stage, blob))
if S_ISLNK(st.st_mode): # In PY3, readlink is a string, but we need bytes. # In PY2, it was just OS encoded bytes, we assumed UTF-8. open_stream: Callable[[], BinaryIO] = lambda: BytesIO(force_bytes(os.readlink(filepath), encoding=defenc)) def open_stream() -> BinaryIO: return BytesIO(force_bytes(os.readlink(filepath), encoding=defenc)) else: open_stream = lambda: open(filepath, "rb")
def open_stream() -> BinaryIO: return open(filepath, "rb")
with open_stream() as stream: fprogress(filepath, False, filepath) istream = self.repo.odb.store(IStream(Blob.type, st.st_size, stream))
# FIXME: Reading from GIL! make_exc = lambda: GitCommandError(("git-checkout-index",) + tuple(args), 128, proc.stderr.read()) def make_exc() -> GitCommandError: return GitCommandError(("git-checkout-index", *args), 128, proc.stderr.read())
checked_out_files: List[PathLike] = []
for path in paths: