Skip to content

Partial fix to issue #142 #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion git/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ def _get_fetch_info_from_stderr(self, proc, progress):
# this also waits for the command to finish
# Skip some progress lines that don't provide relevant information
fetch_info_lines = list()
seen_refs = set()
for line in digest_process_messages(proc.stderr, progress):
if line.startswith('From') or line.startswith('remote: Total') or line.startswith('POST'):
continue
Expand All @@ -529,14 +530,17 @@ def _get_fetch_info_from_stderr(self, proc, progress):
raise GitCommandError(("Error when fetching: %s" % line,), 2)
# END handle special messages
fetch_info_lines.append(line)
ref = re.search(r'\b(\S+)\s+->\s', line)
if ref:
seen_refs.add(ref.group(1))
# END for each line

# read head information
fp = open(join(self.repo.git_dir, 'FETCH_HEAD'),'r')
fetch_head_info = fp.readlines()
fp.close()

assert len(fetch_info_lines) == len(fetch_head_info), "len(%s) != len(%s)" % (fetch_head_info, fetch_info_lines)
assert len(seen_refs) == len(fetch_head_info), "len(%s) != len(%s)" % (fetch_head_info, fetch_info_lines)

output.extend(FetchInfo._from_line(self.repo, err_line, fetch_line)
for err_line,fetch_line in zip(fetch_info_lines, fetch_head_info))
Expand Down