use notify::{RecursiveMode, Watcher};
use std::path::Path;
use crate::services::git_watcher::GitWatcher;
impl GitWatcher {
pub fn watch(&mut self, repo_path: &Path) -> Result<(), notify::Error> {
let git_dir = repo_path.join(".git");
self.watcher.watch(&git_dir, RecursiveMode::Recursive)?;
self.repo_path = Some(repo_path.to_path_buf());
self.has_pending_changes = true;
Ok(())
}
}