Expand description
Git integration utilities.
Helpers for interacting with git repositories — status, diff, log, blame, and branch operations. All operations shell out to the git CLI for maximum compatibility.
Structs§
- Diff
File - A file in a parsed diff.
- Diff
Hunk - A hunk within a diff file.
- Diff
Line - A single line in a diff hunk.
Enums§
Functions§
- blame
- Get blame for a file (abbreviated).
- canonical_
root - Resolve the canonical repository root, following worktree links.
- current_
branch - Get the current branch name.
- default_
branch - Get the default/main branch name.
- diff
- Get staged and unstaged diff.
- diff_
from_ base - Get the diff between the current branch and the default branch.
- is_
git_ repo - Check if the given directory is inside a git repository.
- is_
shallow - Check if the repository is a shallow clone.
- is_
worktree - Check if the current directory is inside a worktree (not the main checkout).
- log
- Get recent commit log.
- parse_
diff - Parse a unified diff into structured hunks.
- repo_
root - Get the root of the current git repository.
- status
- Get git status (short format).