Skip to content

Commit

Permalink
git,remote: use universal new lines for fetch/pull stderr capture
Browse files Browse the repository at this point in the history
See gitpython-developers#1969

stderr parser call RemoteProgress update on each line received.
With universal_newlines set to False, there is a mixup between
line feed and carriage return.
In the `handle_process_output` thread, this is thus seen as a single
line for the whole output on each steps.
  • Loading branch information
fvalette-ledger committed Oct 14, 2024
1 parent 49ca909 commit 1bb4651
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ def _get_fetch_info_from_stderr(
None,
progress_handler,
finalizer=None,
decode_streams=True,
decode_streams=False,
kill_after_timeout=kill_after_timeout,
)

Expand Down Expand Up @@ -1071,7 +1071,7 @@ def fetch(
Git.check_unsafe_options(options=list(kwargs.keys()), unsafe_options=self.unsafe_git_fetch_options)

proc = self.repo.git.fetch(
"--", self, *args, as_process=True, with_stdout=False, universal_newlines=False, v=verbose, **kwargs
"--", self, *args, as_process=True, with_stdout=False, universal_newlines=True, v=verbose, **kwargs
)
res = self._get_fetch_info_from_stderr(proc, progress, kill_after_timeout=kill_after_timeout)
if hasattr(self.repo.odb, "update_cache"):
Expand Down Expand Up @@ -1125,7 +1125,7 @@ def pull(
Git.check_unsafe_options(options=list(kwargs.keys()), unsafe_options=self.unsafe_git_pull_options)

proc = self.repo.git.pull(
"--", self, refspec, with_stdout=False, as_process=True, universal_newlines=False, v=True, **kwargs
"--", self, refspec, with_stdout=False, as_process=True, universal_newlines=True, v=True, **kwargs
)
res = self._get_fetch_info_from_stderr(proc, progress, kill_after_timeout=kill_after_timeout)
if hasattr(self.repo.odb, "update_cache"):
Expand Down

0 comments on commit 1bb4651

Please sign in to comment.