summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2011-06-13 15:57:42 +0200
committerSebastian Thiel <byronimo@gmail.com>2011-06-13 17:15:15 +0200
commit963bbd722aebc622f7a36945a46f324855c3e1d2 (patch)
treef084e49ea0fe4ba32fd853424e27880aeec7d381
parent4bf372dc4064b1ff30140ab4c11fa6830e695504 (diff)
downloadgitpython-963bbd722aebc622f7a36945a46f324855c3e1d2.tar.gz
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
-rw-r--r--git/db/cmd/base.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/git/db/cmd/base.py b/git/db/cmd/base.py
index ef22c931..95c587db 100644
--- a/git/db/cmd/base.py
+++ b/git/db/cmd/base.py
@@ -226,7 +226,18 @@ class CmdRemoteProgress(RemoteProgress):
elif op_name == "Resolving deltas":
op_code |= self.RESOLVING
else:
- raise ValueError("Operation name %r unknown" % op_name)
+ # Note: On windows it can happen that partial lines are sent
+ # Hence we get something like "CompreReceiving objects", which is
+ # a blend of "Compressing objects" and "Receiving objects".
+ # This can't really be prevented, so we drop the line verbosely
+ # to make sure we get informed in case the process spits out new
+ # commands at some point.
+ self.line_dropped(sline)
+ sys.stderr.write("Operation name %r unknown - skipping line '%s'" % (op_name, sline))
+ # Note: Don't add this line to the failed lines, as we have to silently
+ # drop it
+ return failed_lines
+ #END handle opcode
# figure out stage
if op_code not in self._seen_ops: