rust_filesearch/models/
git_status.rs

1use super::Entry;
2use serde::{Deserialize, Serialize};
3
4/// Represents a file with git status information
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct GitEntry {
7    /// The filesystem entry
8    #[serde(flatten)]
9    pub entry: Entry,
10    /// Git status of the file
11    pub status: GitStatus,
12    /// Current branch name (if in a repo)
13    #[serde(skip_serializing_if = "Option::is_none")]
14    pub branch: Option<String>,
15}
16
17/// Git file status
18#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
19#[serde(rename_all = "lowercase")]
20pub enum GitStatus {
21    /// File is not tracked by git
22    Untracked,
23    /// File has modifications in working directory
24    Modified,
25    /// File is staged for commit
26    Staged,
27    /// File has merge conflicts
28    Conflict,
29    /// File is tracked and unchanged
30    Clean,
31    /// File is ignored by .gitignore
32    Ignored,
33}