From fe50c75cf627a6b0bf4706d44ef5b7ad84de7dc7 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 13 Jul 2019 10:20:36 +0200 Subject: Include git stderr in error message Signed-off-by: Matthias Beyer --- src/git.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/git.rs b/src/git.rs index 0f59c69..35b3dbf 100644 --- a/src/git.rs +++ b/src/git.rs @@ -19,9 +19,12 @@ pub fn crawl_git_tree>(path: P) -> io::Result> { .output()?; if !output.status.success() { + let errstr = String::from_utf8(output.stderr) + .unwrap_or_else(|_| String::from("")); + return Err(io::Error::new( io::ErrorKind::Other, - "git ls-tree did not run successfully", + format!("git ls-tree did not run successfully: {}", errstr), )); } -- cgit v1.2.3