//! Serializable types for the branch domain.

use serde::{Deserialize, Serialize};

use crate::commit::types::CommitOid;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BranchInfo {
    pub name: String,
    pub oid: CommitOid,
    pub is_head: bool,
    pub is_remote: bool,
    pub is_current: bool,
    pub upstream: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BranchSummary {
    pub local_count: usize,
    pub remote_count: usize,
    pub all_count: usize,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BranchDiff {
    pub ahead: usize,
    pub behind: usize,
    pub diverged: bool,
}
