File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -646,6 +646,10 @@ def stdout_handler(line):
646646
647647 try :
648648 handle_process_output (proc , stdout_handler , progress_handler , finalize_process )
649+ except GitCommandError as err :
650+ # convert any error from wait() into the same error with stdout lines
651+ raise GitCommandError ( err .command , err .status , progress .get_stderr () )
652+
649653 except Exception :
650654 if len (output ) == 0 :
651655 raise
Original file line number Diff line number Diff line change @@ -173,13 +173,17 @@ class RemoteProgress(object):
173173 DONE_TOKEN = 'done.'
174174 TOKEN_SEPARATOR = ', '
175175
176- __slots__ = ("_cur_line" , "_seen_ops" )
176+ __slots__ = ("_cur_line" , "_seen_ops" , "_error_lines" )
177177 re_op_absolute = re .compile (r"(remote: )?([\w\s]+):\s+()(\d+)()(.*)" )
178178 re_op_relative = re .compile (r"(remote: )?([\w\s]+):\s+(\d+)% \((\d+)/(\d+)\)(.*)" )
179179
180180 def __init__ (self ):
181181 self ._seen_ops = list ()
182182 self ._cur_line = None
183+ self ._error_lines = []
184+
185+ def get_stderr (self ):
186+ return '\n ' .join (self ._error_lines )
183187
184188 def _parse_progress_line (self , line ):
185189 """Parse progress information from the given line as retrieved by git-push
@@ -190,6 +194,10 @@ def _parse_progress_line(self, line):
190194 # Counting objects: 4, done.
191195 # Compressing objects: 50% (1/2) \rCompressing objects: 100% (2/2) \rCompressing objects: 100% (2/2), done.
192196 self ._cur_line = line
197+ if len (self ._error_lines ) > 0 or self ._cur_line .startswith ( ('error:' , 'fatal:' ) ):
198+ self ._error_lines .append ( self ._cur_line )
199+ return []
200+
193201 sub_lines = line .split ('\r ' )
194202 failed_lines = list ()
195203 for sline in sub_lines :
You can’t perform that action at this time.
0 commit comments