use anyhow::Result;
use std::collections::HashSet;
use std::path::{Path, PathBuf};
pub mod git;
pub trait ScmCommit: Clone {}
pub trait Scm<Commit: ScmCommit> {
fn get_changed_files(&self, commit: &Commit) -> Result<HashSet<PathBuf>>;
fn get_all_repo_files(&self) -> Result<HashSet<PathBuf>>;
fn is_working_dir_clean(&self) -> Result<bool>;
fn get_head_commit(&self) -> Result<Commit>;
fn get_commit_identifier(&self, commit: &Commit) -> String;
fn get_commit_parents(&self, commit: &Commit) -> Result<Vec<Commit>>;
fn get_best_common_ancestor(&self, commits: &[Commit]) -> Result<Option<Commit>>;
fn fetch_file_content(&self, commit: &Commit, path: &Path) -> Result<Vec<u8>>;
fn checkout(&self, commit: &Commit) -> Result<()>;
fn clean_lightly(&self) -> Result<()>;
}