diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-21 09:36:10 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-21 09:38:12 +0100 |
commit | c3c6c81b3281333a5a1152f667c187c9dce12944 (patch) | |
tree | 73084c11c992b810e7a539b810c6130803d59a24 | |
parent | 47ac37be2e0e14e958ad24dc8cba1fa4b7f78700 (diff) | |
parent | 0ed61f72c611deb07e0368cebdc9f06da32150cd (diff) | |
download | gitpython-c3c6c81b3281333a5a1152f667c187c9dce12944.tar.gz |
Merge branch 'issue-232-reproduction' - keep fetch/pull simplifications
Make sure we keep the improvements made to fetch and pull
Relates to #232
-rw-r--r-- | git/remote.py | 8 | ||||
-rw-r--r-- | git/test/test_remote.py | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/git/remote.py b/git/remote.py index 541f3c9e..dbb82796 100644 --- a/git/remote.py +++ b/git/remote.py @@ -523,7 +523,9 @@ class Remote(LazyMixin, Iterable): progress_handler = progress.new_message_handler() - def my_progress_handler(line): + for line in proc.stderr: + line = line.decode(defenc) + line = line.rstrip() for pline in progress_handler(line): if line.startswith('fatal:'): raise GitCommandError(("Error when fetching: %s" % line,), 2) @@ -538,7 +540,7 @@ class Remote(LazyMixin, Iterable): # 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') @@ -608,6 +610,7 @@ class Remote(LazyMixin, Iterable): args = [refspec] proc = self.repo.git.fetch(self, *args, with_extended_output=True, as_process=True, v=True, **kwargs) + proc.stdout.close() res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress()) if hasattr(self.repo.odb, 'update_cache'): self.repo.odb.update_cache() @@ -623,6 +626,7 @@ class Remote(LazyMixin, Iterable): :return: Please see 'fetch' method """ kwargs = add_progress(kwargs, self.repo.git, progress) proc = self.repo.git.pull(self, refspec, with_extended_output=True, as_process=True, v=True, **kwargs) + proc.stdout.close() res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress()) if hasattr(self.repo.odb, 'update_cache'): self.repo.odb.update_cache() diff --git a/git/test/test_remote.py b/git/test/test_remote.py index 75dc19c5..110f1fa5 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -348,6 +348,7 @@ class TestRemote(TestBase): new_head = Head.create(rw_repo, "my_new_branch") progress = TestRemoteProgress() res = remote.push(new_head, progress) + assert len(res) > 0 assert res[0].flags & PushInfo.NEW_HEAD progress.make_assertion() self._do_test_push_result(res, remote) |