@@ -530,7 +530,10 @@ def unmerged_blobs(self) -> Dict[PathLike, List[Tuple[StageType, Blob]]]:
530530 stage. That is, a file removed on the 'other' branch whose entries are at
531531 stage 3 will not have a stage 3 entry.
532532 """
533- is_unmerged_blob = lambda t : t [0 ] != 0
533+
534+ def is_unmerged_blob (t : Tuple [StageType , Blob ]) -> bool :
535+ return t [0 ] != 0
536+
534537 path_map : Dict [PathLike , List [Tuple [StageType , Blob ]]] = {}
535538 for stage , blob in self .iter_blobs (is_unmerged_blob ):
536539 path_map .setdefault (blob .path , []).append ((stage , blob ))
@@ -690,12 +693,17 @@ def _store_path(self, filepath: PathLike, fprogress: Callable) -> BaseIndexEntry
690693 This must be ensured in the calling code.
691694 """
692695 st = os .lstat (filepath ) # Handles non-symlinks as well.
696+
693697 if S_ISLNK (st .st_mode ):
694698 # In PY3, readlink is a string, but we need bytes.
695699 # In PY2, it was just OS encoded bytes, we assumed UTF-8.
696- open_stream : Callable [[], BinaryIO ] = lambda : BytesIO (force_bytes (os .readlink (filepath ), encoding = defenc ))
700+ def open_stream () -> BinaryIO :
701+ return BytesIO (force_bytes (os .readlink (filepath ), encoding = defenc ))
697702 else :
698- open_stream = lambda : open (filepath , "rb" )
703+
704+ def open_stream () -> BinaryIO :
705+ return open (filepath , "rb" )
706+
699707 with open_stream () as stream :
700708 fprogress (filepath , False , filepath )
701709 istream = self .repo .odb .store (IStream (Blob .type , st .st_size , stream ))
@@ -1336,8 +1344,11 @@ def handle_stderr(proc: "Popen[bytes]", iter_checked_out_files: Iterable[PathLik
13361344 kwargs ["as_process" ] = True
13371345 kwargs ["istream" ] = subprocess .PIPE
13381346 proc = self .repo .git .checkout_index (args , ** kwargs )
1347+
13391348 # FIXME: Reading from GIL!
1340- make_exc = lambda : GitCommandError (("git-checkout-index" ,) + tuple (args ), 128 , proc .stderr .read ())
1349+ def make_exc () -> GitCommandError :
1350+ return GitCommandError (("git-checkout-index" , * args ), 128 , proc .stderr .read ())
1351+
13411352 checked_out_files : List [PathLike ] = []
13421353
13431354 for path in paths :
0 commit comments