| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5077fc7 commit 78f3f38
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -646,6 +646,10 @@ def stdout_handler(line): | |||
| 646 | 646 | ||
| 647 | 647 | try: | |
| 648 | 648 | 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 | + | ||
| 649 | 653 | except Exception: | |
| 650 | 654 | if len(output) == 0: | |
| 651 | 655 | raise | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -173,13 +173,17 @@ class RemoteProgress(object): | |||
| 173 | 173 | DONE_TOKEN = 'done.' | |
| 174 | 174 | TOKEN_SEPARATOR = ', ' | |
| 175 | 175 | ||
| 176 | - __slots__ = ("_cur_line", "_seen_ops") | ||
| 176 | + __slots__ = ("_cur_line", "_seen_ops", "_error_lines") | ||
| 177 | 177 | re_op_absolute = re.compile(r"(remote: )?([\w\s]+):\s+()(\d+)()(.*)") | |
| 178 | 178 | re_op_relative = re.compile(r"(remote: )?([\w\s]+):\s+(\d+)% \((\d+)/(\d+)\)(.*)") | |
| 179 | 179 | ||
| 180 | 180 | def __init__(self): | |
| 181 | 181 | self._seen_ops = list() | |
| 182 | 182 | self._cur_line = None | |
| 183 | + self._error_lines = [] | ||
| 184 | + | ||
| 185 | + def get_stderr(self): | ||
| 186 | + return '\n'.join(self._error_lines) | ||
| 183 | 187 | ||
| 184 | 188 | def _parse_progress_line(self, line): | |
| 185 | 189 | """Parse progress information from the given line as retrieved by git-push | |
@@ -190,6 +194,10 @@ def _parse_progress_line(self, line): | |||
| 190 | 194 | # Counting objects: 4, done. | |
| 191 | 195 | # Compressing objects: 50% (1/2) \rCompressing objects: 100% (2/2) \rCompressing objects: 100% (2/2), done. | |
| 192 | 196 | 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 | + | ||
| 193 | 201 | sub_lines = line.split('\r') | |
| 194 | 202 | failed_lines = list() | |
| 195 | 203 | for sline in sub_lines: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments