use std::io;
use std::process::ExitStatus;
use std::time::Duration;
#[derive(Debug, thiserror::Error)]
pub enum GitCallError {
#[error("git {command} could not start: {source}")]
NotStarted {
command: &'static str,
source: io::Error,
},
#[error("git {command} did not finish within {after:?}")]
TimedOut {
command: &'static str,
after: Duration,
},
#[error("git {command} exited with {status}: {stderr}")]
Refused {
command: &'static str,
status: ExitStatus,
stderr: String,
},
#[error("git {command} got an argument with an embedded null byte")]
NullByte { command: &'static str },
#[error("git {command} printed something unreadable: {reason}")]
Malformed {
command: &'static str,
reason: String,
},
}