| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bed4630 commit b0be02e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,8 +20,6 @@ | |||
| 20 | 20 | SymbolicReference, | |
| 21 | 21 | TagReference | |
| 22 | 22 | ) | |
| 23 | - | ||
| 24 | - | ||
| 25 | 23 | from git.util import ( | |
| 26 | 24 | LazyMixin, | |
| 27 | 25 | Iterable, | |
@@ -35,6 +33,9 @@ | |||
| 35 | 33 | from git.cmd import handle_process_output | |
| 36 | 34 | from gitdb.util import join | |
| 37 | 35 | from git.compat import defenc | |
| 36 | + import logging | ||
| 37 | + | ||
| 38 | + log = logging.getLogger('git.remote') | ||
| 38 | 39 | ||
| 39 | 40 | ||
| 40 | 41 | __all__ = ('RemoteProgress', 'PushInfo', 'FetchInfo', 'Remote') | |
@@ -570,10 +571,16 @@ def _get_fetch_info_from_stderr(self, proc, progress): | |||
| 570 | 571 | fetch_head_info = [l.decode(defenc) for l in fp.readlines()] | |
| 571 | 572 | fp.close() | |
| 572 | 573 | ||
| 573 | - # NOTE: We assume to fetch at least enough progress lines to allow matching each fetch head line with it. | ||
| 574 | 574 | l_fil = len(fetch_info_lines) | |
| 575 | 575 | l_fhi = len(fetch_head_info) | |
| 576 | - assert l_fil >= l_fhi, "len(%s) <= len(%s)" % (l_fil, l_fhi) | ||
| 576 | + if l_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 | ||
| 577 | 584 | ||
| 578 | 585 | output.extend(FetchInfo._from_line(self.repo, err_line, fetch_line) | |
| 579 | 586 | for err_line, fetch_line in zip(fetch_info_lines, fetch_head_info)) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments