diff --git a/git/remote.py b/git/remote.py index c9da19791..dcab2c402 100644 --- a/git/remote.py +++ b/git/remote.py @@ -346,7 +346,7 @@ class Remote(LazyMixin, Iterable): NOTE: When querying configuration, the configuration accessor will be cached to speed up subsequent accesses.""" - __slots__ = ("repo", "name", "_config_reader") + __slots__ = ("repo", "name", "_config_reader", "fetch_no") _id_attribute_ = "name" def __init__(self, repo, name): @@ -356,6 +356,7 @@ def __init__(self, repo, name): :param name: the name of the remote, i.e. 'origin'""" self.repo = repo self.name = name + self.fetch_no = 0 if os.name == 'nt': # some oddity: on windows, python 2.5, it for some reason does not realize @@ -551,6 +552,9 @@ def _get_fetch_info_from_stderr(self, proc, progress): progress_handler = progress.new_message_handler() def my_progress_handler(line): + stderr_fetch = open(join(self.repo.git_dir, '%03i_debug_git-python_stderr' % self.fetch_no), 'ab') + stderr_fetch.write((line + '\n').encode(defenc)) + stderr_fetch.close() for pline in progress_handler(line): if line.startswith('fatal:') or line.startswith('error:'): raise GitCommandError(("Error when fetching: %s" % line,), 2) @@ -567,6 +571,11 @@ def my_progress_handler(line): # We are only interested in stderr here ... handle_process_output(proc, None, my_progress_handler, finalize_process) + import shutil + shutil.copyfile(join(self.repo.git_dir, 'FETCH_HEAD'), join(self.repo.git_dir, + '%03i_debug_git-python_FETCH_HEAD' % self.fetch_no)) + self.fetch_no += 1 + # read head information fp = open(join(self.repo.git_dir, 'FETCH_HEAD'), 'rb') fetch_head_info = [l.decode(defenc) for l in fp.readlines()]
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: