Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit59587d8

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 parent48fab54 commit59587d8

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

‎.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "gitdb"]
2-
path=git/ext/gitdb
3-
url=git://github.com/gitpython-developers/gitdb.git
1+
[submodule "gitdb"]
2+
path=git/ext/gitdb
3+
url=git://github.com/gitpython-developers/gitdb.git

‎git/remote.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def digest_process_messages(fh, progress):
4949
ifnotchar:
5050
break
5151

52-
ifcharin ('\r','\n'):
52+
ifcharin ('\r','\n')andline_so_far:
5353
dropped_lines.extend(progress._parse_progress_line(line_so_far))
5454
line_so_far=''
5555
else:
@@ -510,7 +510,7 @@ def _get_fetch_info_from_stderr(self, proc, progress):
510510
fetch_head_info=fp.readlines()
511511
fp.close()
512512

513-
assertlen(fetch_info_lines)==len(fetch_head_info)
513+
assertlen(fetch_info_lines)==len(fetch_head_info),"len(%s) != len(%s)"% (fetch_head_info,fetch_info_lines)
514514

515515
output.extend(FetchInfo._from_line(self.repo,err_line,fetch_line)
516516
forerr_line,fetch_lineinzip(fetch_info_lines,fetch_head_info))

‎git/util.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,18 @@ def _parse_progress_line(self, line):
176176
elifop_name=='Resolving deltas':
177177
op_code|=self.RESOLVING
178178
else:
179-
raiseValueError("Operation name %r unknown"%op_name)
179+
# Note: On windows it can happen that partial lines are sent
180+
# Hence we get something like "CompreReceiving objects", which is
181+
# a blend of "Compressing objects" and "Receiving objects".
182+
# This can't really be prevented, so we drop the line verbosely
183+
# to make sure we get informed in case the process spits out new
184+
# commands at some point.
185+
self.line_dropped(sline)
186+
sys.stderr.write("Operation name %r unknown - skipping line '%s'"% (op_name,sline))
187+
# Note: Don't add this line to the failed lines, as we have to silently
188+
# drop it
189+
returnfailed_lines
190+
# END handle op code
180191

181192
# figure out stage
182193
ifop_codenotinself._seen_ops:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp