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:
+9
-3
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user