From 1faea485caa70a2372befeccc79433b52cadbc64 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Thu, 30 Jan 2025 17:13:16 +0900 Subject: [PATCH] git: enable sideband progress on subprocess push The parsing function is adjusted in case stderr contained unparsed progress messages. --- lib/src/git_subprocess.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/git_subprocess.rs b/lib/src/git_subprocess.rs index 2f7f2ed01..1d653e0b3 100644 --- a/lib/src/git_subprocess.rs +++ b/lib/src/git_subprocess.rs @@ -206,6 +206,9 @@ impl<'a> GitSubprocessContext<'a> { let mut command = self.create_command(); command.stdout(Stdio::piped()); command.args(["push", "--porcelain"]); + if callbacks.progress.is_some() { + command.arg("--progress"); + } command.args( references .iter() @@ -477,7 +480,8 @@ fn parse_git_push_output(output: Output) -> Result<(Vec, Vec), G if output .stderr - .starts_with_str("error: failed to push some refs to ") + .lines() + .any(|line| line.starts_with(b"error: failed to push some refs to ")) { parse_ref_pushes(&output.stdout) } else {