|
@@ -0,0 +1,33 @@
|
|
|
+use git2::Repository;
|
|
|
+
|
|
|
+use crate::ArticlesRepository;
|
|
|
+
|
|
|
+pub struct GitRepository<'a> {
|
|
|
+ repo: &'a git2::Repository
|
|
|
+}
|
|
|
+
|
|
|
+impl<'a> GitRepository<'a> {
|
|
|
+ fn new(repo: &'a git2::Repository) -> Self {
|
|
|
+ GitRepository {
|
|
|
+ repo
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//Modification times: https://github.com/Shnatsel/rustsec/blob/f043c75731df311292a7e4f4dbb05c6728d055f5/rustsec/src/repository/git/modification_time.rs#L18
|
|
|
+impl<'a> ArticlesRepository for GitRepository<'a> {
|
|
|
+ fn get_directory_listing(&self, path: &str) -> Vec<String> {
|
|
|
+ vec![]
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+#[cfg(test)]
|
|
|
+mod tests_git_repository {
|
|
|
+ use super::*;
|
|
|
+
|
|
|
+ #[test]
|
|
|
+ fn when_path_is_empty_should_return_nothing() {}
|
|
|
+
|
|
|
+ #[test]
|
|
|
+ fn when_path_is_valid_should_return_proper_listing() {}
|
|
|
+}
|