use crate::{bare::GitBare, errors::GitResult};

pub struct BranchDeleteParams {
    pub name: String,
    pub force: bool,
}

impl GitBare {
    pub fn branch_delete(&self, params: BranchDeleteParams) -> GitResult<()> {
        let flag = if params.force { "-D" } else { "-d" };
        self.git_command_trusted(vec![
            "branch".to_string(),
            flag.to_string(),
            params.name,
        ])?;
        Ok(())
    }
}
