fluidattacks-core-git 0.51.0

Fluid Attacks Core Git
Documentation
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,
    },
    /// git ran and refused, as it does for a missing repository or revision.
    #[error("git {command} exited with {status}: {stderr}")]
    Refused {
        command: &'static str,
        status: ExitStatus,
        stderr: String,
    },
    /// No process can receive a NUL, so std turns the call down before it starts.
    #[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,
    },
}

/// How extracting a gzipped tar failed.
#[derive(Debug, thiserror::Error)]
pub enum ExtractError {
    /// The archive is not gzip, its tar or deflate data is broken, or its
    /// checksum does not match.
    #[error("corrupt archive: {0}")]
    Corrupt(#[source] io::Error),
    /// The gzip stream ends before its trailer.
    #[error("truncated archive: {0}")]
    Truncated(#[source] io::Error),
    #[error("extracting the archive: {0}")]
    Io(#[source] io::Error),
}