use anyhow::Result;
use std::fs::Metadata;
use std::path::Path;
use std::process::{Child, Command, Output};
pub trait FileEnv: Send + Sync {
fn read_to_string(&self, path: &Path) -> std::io::Result<String>;
fn write(&self, path: &Path, content: &str) -> std::io::Result<()>;
fn exists(&self, path: &Path) -> bool;
fn metadata(&self, path: &Path) -> std::io::Result<Metadata>;
fn create_dir_all(&self, path: &Path) -> std::io::Result<()>;
fn remove_file(&self, path: &Path) -> std::io::Result<()>;
fn remove_dir_all(&self, path: &Path) -> std::io::Result<()>;
}
pub trait ProcessEnv: Send + Sync {
fn spawn(&self, cmd: &mut Command) -> std::io::Result<Child>;
fn run(&self, cmd: &mut Command) -> std::io::Result<Output>;
}
pub trait GitEnv: Send + Sync {
fn worktree_add(&self, path: &Path, branch: &str) -> Result<()>;
fn worktree_remove(&self, path: &Path) -> Result<()>;
fn worktree_list(&self) -> Result<Vec<String>>;
fn merge(&self, branch: &str) -> Result<()>;
fn commit(&self, message: &str) -> Result<String>;
fn head_sha(&self) -> Result<String>;
fn create_branch(&self, name: &str) -> Result<()>;
fn checkout(&self, branch: &str) -> Result<()>;
fn current_branch(&self) -> Result<String>;
fn is_clean(&self) -> Result<bool>;
}
pub trait DbEnv: Send + Sync {
}