aboutsummaryrefslogtreecommitdiff
path: root/src/git/repo.rs
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2020-06-22 16:33:28 +0200
committerKatharina Fey <kookie@spacekookie.de>2020-06-22 16:33:28 +0200
commita0dca8186bdef76e09e9c388d7f85839e85ce8db (patch)
treee10257f724b01ddc9b8244c9b2429921612b6856 /src/git/repo.rs
parent367cb0b2358be04d18dfea963d1c42044893e3b4 (diff)
git: refactoring git module to have a unified actions API
Diffstat (limited to 'src/git/repo.rs')
-rw-r--r--src/git/repo.rs19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/git/repo.rs b/src/git/repo.rs
deleted file mode 100644
index 0d04b0d..0000000
--- a/src/git/repo.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-use crate::templ_data::repo::RepoData;
-use git2::{Oid, Repository, Tree};
-
-/// Represents a repo in libgit2
-pub(crate) struct Repo {
- pub(crate) inner: Repository,
-}
-
-impl Repo {
- pub(crate) fn new(path: &str) -> Self {
- Self {
- inner: Repository::open(path).expect(&format!("`{}` is not a valid git repo", path)),
- }
- }
-}
-
-pub(crate) fn get_tree<'r>(repo: &'r Repository, rev: &str) -> Tree<'r> {
- repo.revparse_single(rev).unwrap().peel_to_tree().unwrap()
-}