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

Commit1537aab

Browse files
committed
fix(remote): better array truncation logic
Previously, the logic was not correct. Now it should work either way,truncating the correct list to assure both always have the same length.Related togitpython-developers#442
1 parentb0be02e commit1537aab

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

‎git/remote.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -573,15 +573,19 @@ def _get_fetch_info_from_stderr(self, proc, progress):
573573

574574
l_fil=len(fetch_info_lines)
575575
l_fhi=len(fetch_head_info)
576-
ifl_fil>=l_fhi:
577-
msg="Fetch headdoesnotcontain enoughlinesto match with progress information\n"
576+
ifl_fil!=l_fhi:
577+
msg="Fetch headlines donotmatchlinesprovided via progress information\n"
578578
msg+="length of progress lines %i should be equal to lines in FETCH_HEAD file %i\n"
579-
msg+="Will ignore extra progress lines."
579+
msg+="Will ignore extra progress lines or fetch head lines."
580580
msg%= (l_fil,l_fhi)
581581
log.warn(msg)
582-
fetch_info_lines=fetch_info_lines[:l_fhi]
582+
ifl_fil<l_fhi:
583+
fetch_head_info=fetch_head_info[:l_fil]
584+
else:
585+
fetch_info_lines=fetch_info_lines[:l_fhi]
586+
# end truncate correct list
583587
# end sanity check + sanitization
584-
588+
585589
output.extend(FetchInfo._from_line(self.repo,err_line,fetch_line)
586590
forerr_line,fetch_lineinzip(fetch_info_lines,fetch_head_info))
587591
returnoutput

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp