Files
tty7/crates
l0ng-ai c3233bb39b refactor(git): split core::git into a module tree and move the diff model into it
The source control work needs four kinds of git knowledge — how to run a
process, what the working tree looks like, what a patch looks like, and what
the history looks like — and they were about to pile into one 386-line file.

core/git.rs becomes core/git/{mod,status,diff,log,ops}.rs. Every existing
import path is unchanged: mod.rs still holds the process layer and re-exports
nothing it did not already export.

src/terminal/git_diff.rs moves wholesale into core::git::diff, leaving a
pub-use shim so diff_overlay.rs and right_panel.rs compile untouched. It never
had a gpui dependency, and the headless server should parse a patch with the
same code the GUI does.

Also lands the shared pieces the panel is built on, all inert for now:

- RecordSplitter, LineSplitter's sibling for the two git formats that are not
  newline delimited (porcelain v2 -z, and log with an ASCII record separator).
  It hands out &[u8] because a path in a -z status need not be UTF-8.
- git_output_with_env, so network operations can be told they have no terminal
  to prompt at without the read paths inheriting that.
- The status/log/ops type contracts: the XY pair, unmerged stages, HeadState,
  RepoPath (which refuses to produce a pathspec it cannot represent), the
  row-local graph edge model, and GitOp with its destructive() policy datum.

No behaviour changes. 867 core and 1036 app tests still pass.
2026-08-09 00:13:08 +08:00
..