use crate::error::GitError;
use crate::types::{GitMergeResult, GitStatus, GitWorktree};
use async_trait::async_trait;
use std::path::Path;
#[async_trait]
pub trait GitApi {
async fn ensure_clean(&self) -> Result<(), GitError>;
async fn status(&self) -> Result<GitStatus, GitError>;
async fn current_branch(&self) -> Result<String, GitError>;
async fn head_commit(&self) -> Result<String, GitError>;
async fn changed_files(&self) -> Result<Vec<String>, GitError>;
async fn worktree_add(&self, path: &Path, branch: &str) -> Result<GitWorktree, GitError>;
async fn worktree_remove(&self, path: &Path, force: bool) -> Result<(), GitError>;
async fn worktree_list(&self) -> Result<Vec<GitWorktree>, GitError>;
async fn branch_create(&self, name: &str, start_point: Option<&str>) -> Result<(), GitError>;
async fn branch_delete(&self, name: &str, force: bool) -> Result<(), GitError>;
async fn branch_exists(&self, name: &str) -> Result<bool, GitError>;
async fn checkout(&self, branch: &str) -> Result<(), GitError>;
async fn commit(&self, message: &str) -> Result<String, GitError>;
async fn push(&self, remote: &str, branch: &str, force: bool) -> Result<(), GitError>;
async fn fetch(&self, remote: &str) -> Result<(), GitError>;
async fn merge_tree(&self, base: &str, branch: &str) -> Result<GitMergeResult, GitError>;
async fn rebase(&self, branch: &str) -> Result<(), GitError>;
async fn stash(&self, message: Option<&str>) -> Result<(), GitError>;
async fn diff(&self) -> Result<String, GitError>;
async fn log(
&self,
max_count: Option<usize>,
) -> Result<Vec<crate::types::GitLogEntry>, GitError>;
async fn remotes(&self) -> Result<Vec<crate::types::GitRemote>, GitError>;
}