Skip to content

Commit 963bbd7

Browse files
committed
Made remote line parsing more stable. On windows it can be that we encounter partial or intermixed lines from the pipe. This really shouldn't be, but its windows so it happens
1 parent 4bf372d commit 963bbd7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

git/db/cmd/base.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,18 @@ def _parse_progress_line(self, line):
226226
elif op_name == "Resolving deltas":
227227
op_code |= self.RESOLVING
228228
else:
229-
raise ValueError("Operation name %r unknown" % op_name)
229+
# Note: On windows it can happen that partial lines are sent
230+
# Hence we get something like "CompreReceiving objects", which is
231+
# a blend of "Compressing objects" and "Receiving objects".
232+
# This can't really be prevented, so we drop the line verbosely
233+
# to make sure we get informed in case the process spits out new
234+
# commands at some point.
235+
self.line_dropped(sline)
236+
sys.stderr.write("Operation name %r unknown - skipping line '%s'" % (op_name, sline))
237+
# Note: Don't add this line to the failed lines, as we have to silently
238+
# drop it
239+
return failed_lines
240+
#END handle opcode
230241

231242
# figure out stage
232243
if op_code not in self._seen_ops:

0 commit comments

Comments
 (0)