1pub type Result<T> = std::result::Result<T, Error>;
5
6#[derive(Debug, thiserror::Error)]
8pub enum Error {
9 #[error("not a git repository")]
11 NotARepository,
12
13 #[error("branch not found: {0}")]
15 BranchNotFound(String),
16
17 #[error("reference not found: {0}")]
19 RefNotFound(String),
20
21 #[error("HEAD is detached - checkout a branch first")]
23 DetachedHead,
24
25 #[error("rebase conflict in: {0:?}")]
27 RebaseConflict(Vec<String>),
28
29 #[error("rebase failed: {0}")]
31 RebaseFailed(String),
32
33 #[error("working directory has uncommitted changes")]
35 DirtyWorkingDirectory,
36
37 #[error("remote not found: {0}")]
39 RemoteNotFound(String),
40
41 #[error("invalid remote URL: {0}")]
43 InvalidRemoteUrl(String),
44
45 #[error("push failed: {0}")]
47 PushFailed(String),
48
49 #[error("fetch failed: {0}")]
51 FetchFailed(String),
52
53 #[error("git error: {0}")]
55 Git2(#[from] git2::Error),
56}