diff --git a/src/main.rs b/src/main.rs index 3e7090b..a09d2b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,3 @@ -use std::{path::PathBuf, process::Command}; - -use git2::{Config, Repository}; - #[derive(Debug, thiserror::Error)] enum TciError { #[error("could not understand file system structure, bailing out")] @@ -72,7 +68,7 @@ fn tci(cfg: TciConfig) -> Result<(), Box> { let repo_path = std::env::current_dir()?; // check config before even creating temp dir and cloning repo - let git_config = Config::open(&repo_path.join("config"))?; + let git_config = git2::Config::open(&repo_path.join("config"))?; let tci_script = git_config.get_str("tci.script").unwrap_or(".tci").to_string(); // check if CI is allowed @@ -100,7 +96,7 @@ fn tci(cfg: TciConfig) -> Result<(), Box> { Ok(()) } -fn tci_hook(repo_path: &PathBuf, tci_script: &str) -> Result<(), TciError> { +fn tci_hook(repo_path: &std::path::PathBuf, tci_script: &str) -> Result<(), TciError> { // TODO kind of ew but ehh should do its job let mut name = repo_path.to_string_lossy() .replace(HOME.as_str(), ""); @@ -114,7 +110,7 @@ fn tci_hook(repo_path: &PathBuf, tci_script: &str) -> Result<(), TciError> { let tmp = tempdir::TempDir::new(&format!("tci-{name}"))?; // TODO allow customizing clone? just clone recursive? just let hook setup submodules? - Repository::clone( + git2::Repository::clone( repo_path.to_str() .ok_or(TciError::FsError("repo path is not a valid string"))?, tmp.path(),