libgit2 for reads, the real git binary wherever user config matters
Status, log, and branch reads go through git2 with a vendored libgit2, inside a headless domain::git module that never imports ratatui. Diffs and writes take the other path: git diff and git show subprocesses with lazygit's flag set, so diff drivers, rename detection, and hooks behave exactly as on the command line.
Staging a single hunk becomes a text slice of the diff fed to git apply --cached, parsed by a small byte-range scanner rather than a full diff library. The tradeoff is explicit: libgit2 where it is fast and stable, the git binary where fidelity to the user's own setup matters more than saving a process spawn.
















