sara_core/diff/
options.rs

1//! Diff options for comparing knowledge graphs.
2
3use std::path::PathBuf;
4
5/// Options for computing a diff between two graph states.
6#[derive(Debug, Clone)]
7pub struct DiffOptions {
8    /// First reference (baseline, e.g., "main", "HEAD~1", commit SHA).
9    pub ref1: String,
10    /// Second reference (target, e.g., "HEAD", branch name).
11    pub ref2: String,
12    /// Repository paths to compare.
13    pub repositories: Vec<PathBuf>,
14}
15
16impl DiffOptions {
17    /// Creates new diff options.
18    pub fn new(ref1: impl Into<String>, ref2: impl Into<String>) -> Self {
19        Self {
20            ref1: ref1.into(),
21            ref2: ref2.into(),
22            repositories: Vec::new(),
23        }
24    }
25
26    /// Sets the repository paths.
27    pub fn with_repositories(mut self, repositories: Vec<PathBuf>) -> Self {
28        self.repositories = repositories;
29        self
30    }
31
32    /// Adds a repository path.
33    pub fn add_repository(mut self, path: PathBuf) -> Self {
34        self.repositories.push(path);
35        self
36    }
37}