[snowpatch] [PATCH] git: print info when apply fails

Andrew Donnellan andrew.donnellan at au1.ibm.com
Fri Feb 3 15:24:48 AEDT 2017


From: Russell Currey <ruscur at russell.cc>

It's useful to see the actual output of "git am" when patch application
fails. Print it accordingly.

Signed-off-by: Russell Currey <ruscur at russell.cc>
Signed-off-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

---

already merged, for information only

---
 src/git.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/git.rs b/src/git.rs
index 071f009..51362b5 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -80,6 +80,9 @@ pub fn apply_patch(repo: &Repository, path: &Path)
                  String::from_utf8(output.clone().stdout).unwrap());
         Ok(output)
     } else {
+        info!("Patch failed to apply with text {} {}",
+              String::from_utf8(output.clone().stdout).unwrap(),
+              String::from_utf8(output.clone().stderr).unwrap());
         Command::new("git").arg("am").arg("--abort")
             .current_dir(&workdir).output().unwrap();
         Err("Patch did not apply successfully")
-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com  IBM Australia Limited



More information about the snowpatch mailing list