Skip to main content

termesh_git/
service.rs

1use std::path::Path;
2
3use termesh_core::{
4    GitBranch, GitDiffTarget, GitFileDiff, GitOperation, GitRepositorySnapshot, GitResult,
5};
6
7/// Blocking Git boundary. Production calls it only from `GitWorker` (ADR-0010 ยง1).
8pub trait GitService: Send + 'static {
9    fn snapshot(&mut self, root: &Path) -> GitResult<GitRepositorySnapshot>;
10    fn diff(&mut self, root: &Path, path: &Path, target: GitDiffTarget) -> GitResult<GitFileDiff>;
11    fn branches(&mut self, root: &Path) -> GitResult<Vec<GitBranch>>;
12    fn execute(&mut self, root: &Path, operation: &GitOperation) -> GitResult<String>;
13}