Skip to main content

codetether_agent/tui/app/state/
git_state.rs

1//! State for the TUI git view.
2
3use serde::{Deserialize, Serialize};
4
5/// Mutable state backing the `/git` TUI view.
6///
7/// Captured on demand via [`Self::capture`] by running `git` subprocesses
8/// inside the current workspace directory.
9#[derive(Debug, Clone, Serialize, Deserialize, Default)]
10pub struct GitViewState {
11    /// Current branch name (or `None` if not a git repo).
12    pub branch: Option<String>,
13    /// Number of dirty (modified/untracked) files.
14    pub dirty_files: usize,
15    /// `git log --oneline` lines (limited to last 20).
16    pub log_lines: Vec<String>,
17    /// `git diff --stat` output (staged + unstaged).
18    pub diff_stat: String,
19    /// `git branch -v` lines showing local branches.
20    pub branches: Vec<String>,
21    /// Capture timestamp.
22    pub captured_at: String,
23}