From 3c70ccce19e881cc6a22e273e859c7167c68c6ab Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Fri, 2 Oct 2026 01:18:58 +0200 Subject: [PATCH] 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. --- src/pull.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/pull.rs b/src/pull.rs index 47a455b..5ae64b0 100644 --- a/src/pull.rs +++ b/src/pull.rs @@ -779,10 +779,16 @@ async fn fetch_archive_sources( .output()?; 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); - return Err( - format!("Failed to apply patch: {}\n{}", diff_path.display(), stderr).into(), - ); + return Err(format!( + "Failed to apply patch: {}\n{}{}", + diff_path.display(), + stdout, + stderr + ) + .into()); } debug!("Successfully applied patch: {}", diff_path.display());