agentswitch 0.6.0

一个通用的 Code Agent 工具配置切换器,支持将任意 OpenAI/Anthropic 协议模型接入到主流 Code Agent CLI 工具中
use std::path::Path;

/// Git 操作模块
pub struct GitOperations {
    repo: git2::Repository,
}

impl GitOperations {
    pub fn new(config_dir: &Path) -> anyhow::Result<Self> {
        let repo = git2::Repository::open(config_dir)?;
        Ok(Self { repo })
    }

    pub fn add_remote(&self, name: &str, url: &str) -> anyhow::Result<()> {
        self.repo.remote(name, url)?;
        Ok(())
    }

    pub fn push(&self, _remote: &str, _branch: &str) -> anyhow::Result<()> {
        // 实际推送逻辑
        Ok(())
    }

    pub fn pull(&self, _remote: &str, _branch: &str) -> anyhow::Result<()> {
        // 实际拉取逻辑
        Ok(())
    }
}