#![feature(debug_non_exhaustive, result_flattening)]
#![warn(clippy::all, clippy::pedantic, clippy::cargo)]
#![allow(clippy::missing_errors_doc, clippy::must_use_candidate)]
macro_rules! truncate {
($n:expr, $t:ty) => {{
#[allow(clippy::cast_possible_truncation)]
{
$n as $t
}
}};
}
mod diff;
mod file;
mod repo;
pub use diff::Meta;
pub use file::{Contents as FileContents, File as RepoFile};
pub use repo::Repo;
use std::io;
#[allow(unused)]
use tracing::{debug, error, info, instrument, span, warn};
pub type Result<T> = std::result::Result<T, crate::Error>;
#[derive(Debug, thiserror::Error, displaydoc::Display)]
pub enum Error {
Git2(#[from] git2::Error),
Io(#[from] io::Error),
MissingPath(git2::Oid),
GetFileMetadata(#[source] io::Error, RepoFile),
UndoEmpty,
RedoEmpty,
PathNotFound(RepoFile),
Ignored(RepoFile),
}