Skip to content

Fix missing stderr when the progress parameter of _clone is None #1224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix missing stderr when the progress parameter of _clone is None
  • Loading branch information
liangjingyang committed Apr 22, 2021
commit 3b274b8f8a6ebc425131c2ab00cd04093f59e03d
8 changes: 3 additions & 5 deletions git/repo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,8 +988,6 @@ def init(cls, path: PathLike = None, mkdir: bool = True, odbt: Type[GitCmdObject
def _clone(cls, git: 'Git', url: PathLike, path: PathLike, odb_default_type: Type[GitCmdObjectDB],
progress: Optional[Callable], multi_options: Optional[List[str]] = None, **kwargs: Any
) -> 'Repo':
progress_checked = to_progress_instance(progress)

odbt = kwargs.pop('odbt', odb_default_type)

# when pathlib.Path or other classbased path is passed
Expand All @@ -1012,9 +1010,9 @@ def _clone(cls, git: 'Git', url: PathLike, path: PathLike, odb_default_type: Typ
if multi_options:
multi = ' '.join(multi_options).split(' ')
proc = git.clone(multi, Git.polish_url(url), clone_path, with_extended_output=True, as_process=True,
v=True, universal_newlines=True, **add_progress(kwargs, git, progress_checked))
if progress_checked:
handle_process_output(proc, None, progress_checked.new_message_handler(),
v=True, universal_newlines=True, **add_progress(kwargs, git, progress))
if progress:
handle_process_output(proc, None, to_progress_instance(progress).new_message_handler(),
finalize_process, decode_streams=False)
else:
(stdout, stderr) = proc.communicate()
Expand Down