"feat(io): Panic if Git diff command fails"

This commit is contained in:
Triston Armstrong 2025-01-12 13:11:16 -05:00
parent 28afb4942d
commit 8715e8b753
Signed by: tristonarmstrong
GPG Key ID: A23B48AE45EB6EFE

View File

@ -1,3 +1,4 @@
use core::panic;
use std::{
fs::write,
io::Write,
@ -41,7 +42,11 @@ impl GitGrabber {
.output()
.expect("Failed to get diff");
let b = from_utf8(&staged_files_output.stdout).unwrap();
if !output.status.success() {
panic!("Did you forget to stage your files?");
}
let b = from_utf8(&output.stdout).unwrap();
String::from(b)
}