use crate::services::repo_watcher::helpers::collect_git_changes;
use crate::services::repo_watcher::{GitChangeSet, RepoWatcher};
impl RepoWatcher {
pub fn check_for_changes(&mut self) -> bool {
let mut has_changes = self.has_pending_changes;
self.has_pending_changes = false;
if self.git_watcher.check_for_changes() {
has_changes = true;
}
if self.file_watcher.check_for_changes() {
has_changes = true;
let _ = self.file_watcher.get_changed_paths();
}
if has_changes {
if let Some(repo_path) = self.repo_path.as_ref() {
self.change_set = collect_git_changes(repo_path, self.config.include_untracked);
} else {
self.change_set = GitChangeSet::default();
}
}
has_changes
}
}