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

Commitb0be02e

Browse files
committed
fix(remote): remove assertion in favour of runtime stability
Fixesgitpython-developers#442
1 parentbed4630 commitb0be02e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

‎git/remote.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
SymbolicReference,
2121
TagReference
2222
)
23-
24-
2523
fromgit.utilimport (
2624
LazyMixin,
2725
Iterable,
@@ -35,6 +33,9 @@
3533
fromgit.cmdimporthandle_process_output
3634
fromgitdb.utilimportjoin
3735
fromgit.compatimportdefenc
36+
importlogging
37+
38+
log=logging.getLogger('git.remote')
3839

3940

4041
__all__= ('RemoteProgress','PushInfo','FetchInfo','Remote')
@@ -570,10 +571,16 @@ def _get_fetch_info_from_stderr(self, proc, progress):
570571
fetch_head_info= [l.decode(defenc)forlinfp.readlines()]
571572
fp.close()
572573

573-
# NOTE: We assume to fetch at least enough progress lines to allow matching each fetch head line with it.
574574
l_fil=len(fetch_info_lines)
575575
l_fhi=len(fetch_head_info)
576-
assertl_fil>=l_fhi,"len(%s) <= len(%s)"% (l_fil,l_fhi)
576+
ifl_fil>=l_fhi:
577+
msg="Fetch head does not contain enough lines to match with progress information\n"
578+
msg+="length of progress lines %i should be equal to lines in FETCH_HEAD file %i\n"
579+
msg+="Will ignore extra progress lines."
580+
msg%= (l_fil,l_fhi)
581+
log.warn(msg)
582+
fetch_info_lines=fetch_info_lines[:l_fhi]
583+
# end sanity check + sanitization
577584

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp