From 515a6b9ccf87bd1d3f5f2edd229d442706705df5 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 26 May 2016 19:41:00 +0200 Subject: fix(remote): use universal_newlines for fetch/push That way, real-time parsing of output should finally be possible. Related to #444 --- git/remote.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'git/remote.py') diff --git a/git/remote.py b/git/remote.py index bff26459..169d4f79 100644 --- a/git/remote.py +++ b/git/remote.py @@ -663,8 +663,8 @@ class Remote(LazyMixin, Iterable): else: args = [refspec] - proc = self.repo.git.fetch(self, *args, as_process=True, with_stdout=False, v=True, - **kwargs) + proc = self.repo.git.fetch(self, *args, as_process=True, with_stdout=False, + universal_newlines=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() @@ -682,7 +682,8 @@ class Remote(LazyMixin, Iterable): # No argument refspec, then ensure the repo's config has a fetch refspec. self._assert_refspec() kwargs = add_progress(kwargs, self.repo.git, progress) - proc = self.repo.git.pull(self, refspec, with_stdout=False, as_process=True, v=True, **kwargs) + proc = self.repo.git.pull(self, refspec, with_stdout=False, as_process=True, + universal_newlines=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() @@ -707,7 +708,8 @@ class Remote(LazyMixin, Iterable): If the operation fails completely, the length of the returned IterableList will be null.""" kwargs = add_progress(kwargs, self.repo.git, progress) - proc = self.repo.git.push(self, refspec, porcelain=True, as_process=True, **kwargs) + proc = self.repo.git.push(self, refspec, porcelain=True, as_process=True, + universal_newlines=True, **kwargs) return self._get_push_info(proc, progress or RemoteProgress()) @property -- cgit v1.2.1