pull: include the patch output when a .diff.gz fails to apply

patch reports rejected hunks on stdout, not stderr: the error used
to carry only the diff path and an empty stderr, naming neither the
failing file nor the reason.
This commit is contained in:
2026-10-02 01:18:58 +02:00
parent 69bb29a291
commit 3c70ccce19
+9 -3
View File
@@ -779,10 +779,16 @@ async fn fetch_archive_sources(
.output()?; .output()?;
if !output.status.success() { if !output.status.success() {
// patch reports rejected hunks on stdout, not stderr
let stdout = String::from_utf8_lossy(&output.stdout);
let stderr = String::from_utf8_lossy(&output.stderr); let stderr = String::from_utf8_lossy(&output.stderr);
return Err( return Err(format!(
format!("Failed to apply patch: {}\n{}", diff_path.display(), stderr).into(), "Failed to apply patch: {}\n{}{}",
); diff_path.display(),
stdout,
stderr
)
.into());
} }
debug!("Successfully applied patch: {}", diff_path.display()); debug!("Successfully applied patch: {}", diff_path.display());