A comprehensive collection of reusable TUI components for ratatui including resizable splits, tree views, markdown rendering, toast notifications, dialogs, and terminal embedding
//! Watch a repository for changes.
usestd::path::Path;usecrate::services::repo_watcher::helpers::collect_git_changes;usecrate::services::repo_watcher::RepoWatcher;implRepoWatcher{/// Start watching a repository for changes.
////// This watches the `.git` directory for git state changes and the
/// working tree for file edits. The initial change set is computed
/// immediately after watching starts.
////// # Arguments
////// * `repo_path` - Path to the repository root (where `.git` is located).
////// # Errors
////// Returns a `notify::Error` if the path cannot be watched.
////// # Example
////// ```no_run
/// use ratatui_toolkit::services::repo_watcher::RepoWatcher;
/// use std::path::Path;
////// let mut watcher = RepoWatcher::new().unwrap();
/// watcher.watch(Path::new("/path/to/repo")).unwrap();
/// ```
pubfnwatch(&mutself, repo_path:&Path)->Result<(), notify::Error>{self.git_watcher.watch(repo_path)?;self.file_watcher.watch(repo_path)?;self.repo_path =Some(repo_path.to_path_buf());self.change_set =collect_git_changes(repo_path,self.config.include_untracked);self.has_pending_changes =true;Ok(())}}