Skip to main content

Module git_io

Module git_io 

Source
Expand description

Thin wrappers around the git binary for the TUI overlay.

All git calls in the overlay funnel through run_git so:

  • the binary path lives in exactly one place,
  • stderr is folded into anyhow::Error with the failing argv,
  • empty-repos / non-repo paths surface as errors the slash command can reply with instead of panicking.

Every helper here shells out to git. No in-process git library is pulled in — keeps the TUI overlay’s dependency surface bounded.

Functions§

diff_head
git diff HEAD --no-ext-diff with a fallback for fresh repos.
run_git
Run git <args…> in cwd and return stdout as a String.
status_porcelain_z
git status --porcelain -z parsed into StatusEntrys.