use thiserror::Error;

#[derive(Debug, Error)]
pub enum WorktreeError {
    #[error("Failed to create worktree: {0}")]
    CreationFailed(String),

    #[error("Failed to remove worktree: {0}")]
    RemovalFailed(String),

    #[error("Worktree not found: {0}")]
    NotFound(String),

    #[error("Git operation failed: {0}")]
    GitError(String),

    #[error("Merge conflict detected in: {0}")]
    MergeConflict(String),

    #[error("IO error: {0}")]
    IoError(#[from] std::io::Error),

    #[error("Invalid worktree state: {0}")]
    InvalidState(String),

    #[error("Timeout waiting for operation")]
    Timeout,
}

pub type Result<T> = std::result::Result<T, WorktreeError>;
