@@ -602,7 +602,14 @@ def _index_from_patch_format(cls, repo: "Repo", proc: Union["Popen", "Git.AutoIn
602602
603603 # FIXME: Here SLURPING raw, need to re-phrase header-regexes linewise.
604604 text_list : List [bytes ] = []
605- handle_process_output (proc , text_list .append , None , finalize_process , decode_streams = False )
605+ stderr_list : List [bytes ] = []
606+
607+ def finalize_process_with_stderr (proc : Union ["Popen" , "Git.AutoInterrupt" ]) -> None :
608+ finalize_process (proc , stderr = b"" .join (stderr_list ))
609+
610+ handle_process_output (
611+ proc , text_list .append , stderr_list .append , finalize_process_with_stderr , decode_streams = False
612+ )
606613
607614 # For now, we have to bake the stream.
608615 text = b"" .join (text_list )
@@ -768,11 +775,16 @@ def _index_from_raw_format(cls, repo: "Repo", proc: "Popen") -> "DiffIndex[Diff]
768775 # :100644 100644 687099101... 37c5e30c8... M .gitignore
769776
770777 index : "DiffIndex" = DiffIndex ()
778+ stderr_list : List [bytes ] = []
779+
780+ def finalize_process_with_stderr (proc : Union ["Popen" , "Git.AutoInterrupt" ]) -> None :
781+ finalize_process (proc , stderr = b"" .join (stderr_list ))
782+
771783 handle_process_output (
772784 proc ,
773785 lambda byt : cls ._handle_diff_line (byt , repo , index ),
774- None ,
775- finalize_process ,
786+ stderr_list . append ,
787+ finalize_process_with_stderr ,
776788 decode_streams = False ,
777789 )
778790
0 commit comments