git_x/
lib.rs

1pub mod clean_branches;
2pub mod cli;
3pub mod color_graph;
4pub mod fixup;
5pub mod graph;
6pub mod health;
7pub mod info;
8pub mod large_files;
9pub mod new_branch;
10pub mod prune_branches;
11pub mod rename_branch;
12pub mod since;
13pub mod stash_branch;
14pub mod summary;
15pub mod sync;
16pub mod undo;
17pub mod upstream;
18pub mod what;
19
20/// Common error type for git-x operations
21#[derive(Debug)]
22pub enum GitXError {
23    GitCommand(String),
24    Io(std::io::Error),
25    Parse(String),
26}
27
28impl std::fmt::Display for GitXError {
29    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30        match self {
31            GitXError::GitCommand(cmd) => write!(f, "Git command failed: {cmd}"),
32            GitXError::Io(err) => write!(f, "IO error: {err}"),
33            GitXError::Parse(msg) => write!(f, "Parse error: {msg}"),
34        }
35    }
36}
37
38impl std::error::Error for GitXError {}
39
40impl From<std::io::Error> for GitXError {
41    fn from(err: std::io::Error) -> Self {
42        GitXError::Io(err)
43    }
44}
45
46pub type Result<T> = std::result::Result<T, GitXError>;