Expand description
The repository abstraction journey’s UI talks to.
The UI never touches git2 directly — it goes through RepoBackend.
That keeps the widget code testable: snapshot tests render the real UI
against a deterministic fixture::FixtureBackend instead of needing a
live repository with machine-dependent SHAs and timestamps.
Re-exports§
pub use fixture::FixtureBackend;pub use patch::PartialMode;pub use patch::build_partial_patch;pub use patch::is_change_line;
Modules§
- fixture
- An in-memory
RepoBackendfor tests and demos. - patch
- Reconstructs a minimal unified-diff patch covering only a selected range of lines, so the commit screen can stage or unstage part of a file instead of the whole thing — the engine behind the Stage/Unstage button that floats over a highlighted region in the diff view.
Structs§
- Commit
Info - Everything the UI needs to show about a single commit.
- Diff
- A whole diff, ready to render line-by-line.
- Diff
Line - One rendered line of a unified diff.
- File
Change - One changed path in a commit’s diff against its first parent.
- Git2
Backend - Opens a repository and reads commits/diffs through libgit2.
- RefLabel
- A branch / tag / HEAD label attached to a commit row.
- Working
Status - A snapshot of the working tree for commit mode (à la
git gui).
Enums§
- Change
Status - How a file changed in a commit.
- Diff
Line Kind - The semantic class of a single line in a unified diff. Drives coloring in
the
DiffViewwidget. - RefKind
- What a ref pointing at a commit is.
Traits§
- Repo
Backend - The interface the UI layer depends on. Implemented by the live
Git2Backendand the in-memoryFixtureBackend.
Functions§
- format_
git_ time - Format a Unix timestamp (+ minute offset) as
YYYY-MM-DD HH:MM:SS ±HHMMin the given timezone, with no external date crate. Uses Howard Hinnant’s civil-from-days algorithm so it is correct for the full proleptic Gregorian range.