summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-07-13 10:20:36 +0200
committerWesley Moore <wes@wezm.net>2019-07-14 08:24:28 +1000
commitfe50c75cf627a6b0bf4706d44ef5b7ad84de7dc7 (patch)
tree0627e363d5cbd73e5c6c8d06704769ed2df540e5
parent3584a9c6d10e7d08c0e4d4de09a54561c5c75991 (diff)
Include git stderr in error message
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--src/git.rs5
1 files changed, 4 insertions, 1 deletions
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<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
.output()?;
if !output.status.success() {
+ let errstr = String::from_utf8(output.stderr)
+ .unwrap_or_else(|_| String::from("<could not format git error output as UTF8>"));
+
return Err(io::Error::new(
io::ErrorKind::Other,
- "git ls-tree did not run successfully",
+ format!("git ls-tree did not run successfully: {}", errstr),
));
}