diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2019-07-13 10:20:36 +0200 |
---|---|---|
committer | Wesley Moore <wes@wezm.net> | 2019-07-14 08:24:28 +1000 |
commit | fe50c75cf627a6b0bf4706d44ef5b7ad84de7dc7 (patch) | |
tree | 0627e363d5cbd73e5c6c8d06704769ed2df540e5 | |
parent | 3584a9c6d10e7d08c0e4d4de09a54561c5c75991 (diff) |
Include git stderr in error message
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | src/git.rs | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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), )); } |