use git2::Repository; // /// Represents a repository on disk // struct Repository { // /// We need to be able to query libgit2 later // fs_path: String, // /// The project name (last path element) // name: String, // /// The rope path excluding the name // path: Vec, // } /// A structure that represents an existing bare repo on disk pub struct Repo { pub inner: Repository, } impl Repo { pub fn new(path: &'static str) -> Self { Self { inner: Repository::open_bare(path).unwrap(), } } /// Returns a list of commit hashes for a project pub fn commits(&self) -> Vec { vec!["f6ca929", "43fb776", "1a0fa2f".into()] .into_iter() .map(String::from) .collect() } /// Return the list of contributors fn contributors(&self) -> Vec { vec![ "Katharina Fey ", ] .into_iter() .map(String::from) .collect() } }