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

Commit193df8e

Browse files
committed
Revert "Remove control character stripping."
This reverts commitb207f0e.
1 parent0dd99fe commit193df8e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎git/util.py‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ class RemoteProgress(object):
364364
'_seen_ops',
365365
'error_lines',# Lines that started with 'error:' or 'fatal:'.
366366
'other_lines')# Lines not denoting progress (i.e.g. push-infos).
367-
re_ansi_escape=re.compile(r'\x1B[@-_][0-?]*[ -/]*[@-~]')
368367
re_op_absolute=re.compile(r"(remote: )?([\w\s]+):\s+()(\d+)()(.*)")
369368
re_op_relative=re.compile(r"(remote: )?([\w\s]+):\s+(\d+)% \((\d+)/(\d+)\)(.*)")
370369

@@ -393,7 +392,17 @@ def _parse_progress_line(self, line):
393392

394393
# find escape characters and cut them away - regex will not work with
395394
# them as they are non-ascii. As git might expect a tty, it will send them
396-
line=self.re_ansi_escape.sub('',line)
395+
last_valid_index=None
396+
fori,cinenumerate(reversed(line)):
397+
iford(c)<32:
398+
# its a slice index
399+
last_valid_index=-i-1
400+
# END character was non-ascii
401+
# END for each character in line
402+
iflast_valid_indexisnotNone:
403+
line=line[:last_valid_index]
404+
# END cut away invalid part
405+
line=line.rstrip()
397406

398407
cur_count,max_count=None,None
399408
match=self.re_op_relative.match(line)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp