1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#![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),
}