diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-07-03 15:37:29 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-07-03 15:37:29 +0200 |
commit | 369e564174bfdd592d64a027bebc3f3f41ee8f11 (patch) | |
tree | dbefbff79b5c08947f8f6d5d1c0ba54b2ce4ce54 /git/remote.py | |
parent | 36dbe7e9b55a09c68ba179bcf2c3d3e1b7898ef3 (diff) | |
download | gitpython-369e564174bfdd592d64a027bebc3f3f41ee8f11.tar.gz |
fix(cmd): don't open stdout when fetching
This allows us to use the main thread to parse stderr to get progress,
and resolve assertion failures hopefully once and for all.
Relates to #301
Diffstat (limited to 'git/remote.py')
-rw-r--r-- | git/remote.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/git/remote.py b/git/remote.py index 4871ea5f..7cb0f4f8 100644 --- a/git/remote.py +++ b/git/remote.py @@ -550,7 +550,7 @@ class Remote(LazyMixin, Iterable): progress_handler = progress.new_message_handler() - def my_progress_handler(line): + for line in proc.stderr.readlines(): for pline in progress_handler(line): if line.startswith('fatal:') or line.startswith('error:'): raise GitCommandError(("Error when fetching: %s" % line,), 2) @@ -563,9 +563,7 @@ class Remote(LazyMixin, Iterable): # end for each comand code we know # end for each line progress didn't handle # end - - # We are only interested in stderr here ... - handle_process_output(proc, None, my_progress_handler, finalize_process) + finalize_process(proc) # read head information fp = open(join(self.repo.git_dir, 'FETCH_HEAD'), 'rb') @@ -651,7 +649,8 @@ class Remote(LazyMixin, Iterable): else: args = [refspec] - proc = self.repo.git.fetch(self, *args, with_extended_output=True, as_process=True, v=True, **kwargs) + proc = self.repo.git.fetch(self, *args, with_extended_output=True, as_process=True, with_stdout=True, v=True, + **kwargs) res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress()) if hasattr(self.repo.odb, 'update_cache'): self.repo.odb.update_cache() |