Expand description
Filesystem + git repository inspection.
This module owns both the “is this a git repo?” classification used by
the per-card indicator AND the richer detail collection used by the
Detail view. They share a single collect_summary helper so the same
libgit2 work doesn’t run twice.
The cheap is_dir() + .git-existence check still gates everything —
we only spin up libgit2 when both checks pass.
Structs§
- Branch
Info - Commit
Entry - Committer
Stat - Diff
Line - One line of a unified diff, as rendered in the Diff panel.
- File
Entry - One changed file in the working tree or index.
- File
Revision - Graph
Commit - Graph
Line - Head
Info - Remote
Info - Repo
Info - Repo
Summary - Compact summary used to draw the per-card indicator. Also embedded in
RepoInfoso the Detail view doesn’t re-collect the same data. - Stash
Info - Worktree
Changes - File-level working-tree state collected for the Detail view. Split into four buckets so the UI can render them as separate sections.
Enums§
- Diff
Line Kind - The type of a single line in a unified diff.
- Item
Detail - Item
Status - Per-item filesystem classification carried alongside
config.items.GitRepo’s innerOptionisNonewhen.gitexists but libgit2 couldn’t open or read the repo — we know it’s a repo, we just can’t summarize its state. - TabData
- TabPayload
Functions§
- abort_
merge - Abort the in-progress merge.
- apply_
stash - checkout_
local_ branch - checkout_
remote_ branch - checkout_
tag - commit_
amend - commit_
changes - Create a commit in the repository with the given message. Returns a human-readable error string on failure.
- continue_
merge - Continue the merge after conflicts are resolved.
- create_
branch - Creates a new local branch pointing at HEAD.
- create_
tag - Creates a new lightweight tag pointing at the specified commit OID.
- delete_
local_ branch - Deletes a local branch.
- delete_
remote_ branch - Deletes a remote-tracking branch locally.
- delete_
remote_ tag - Deletes a tag on the remote.
- delete_
stash - delete_
tag - Deletes a local tag.
- deserialize_
tags - discard_
all_ changes - Discard all staged, unstaged, and untracked changes in the repository.
- discard_
file_ changes - Discards uncommitted changes in
file_path. - discard_
hunk - Discard a single hunk of unstaged changes in the working tree (equivalent to
git apply --reverse -). - discard_
line - Discard a single line from the Unstaged diff in the working tree.
- expand_
tilde - Expand a leading
~or~/in a user-supplied path to the user’s home directory. Returns the input unchanged if there is no home dir or no tilde to expand. - get_
branch_ push_ target - Finds the remote target for pushing a branch. Returns
(remote_name, set_upstream). - get_
branch_ upstream_ remote - Returns the upstream tracking remote name for a branch, if configured.
- get_
commit_ file_ diff - Return the unified diff of
file_pathas it changed incommit_oid(hex string) inside the repository atrepo_path. Returns an empty Vec on any error. - get_
commit_ files - get_
conflict_ markers_ diff - Returns the conflict-marker diff for a conflicted file by parsing the file on disk. Colorizes conflict blocks using DiffLineKind variants.
- get_
file_ history - get_
last_ commit_ message - get_
latest_ change_ time - get_
remote_ tags - Helper to run
git ls-remote --tagsand return parsed tag information. - get_
worktree_ file_ diff - Return the diff for
file_pathin the working tree. - has_
upstream_ remote - Returns whether the specified branch has a configured upstream tracking branch.
- inspect_
detail - Inspect
itemand produce the rich detail report shown on Enter. - inspect_
summary - Classify
itemand produce a card-level summary. Used by the list view. - invalidate_
ref_ map_ cache - is_
merging - Returns
truewhen.git/MERGE_HEADexists — i.e. a merge is in progress. Cheap file-existence check, no libgit2 required. - is_
root_ commit - Returns whether the specified commit OID has no parents (i.e. it is the root commit).
- load_
tab_ branches - load_
tab_ files - load_
tab_ graph_ stream - load_
tab_ overview - load_
tab_ remotes - load_
tab_ stashes - load_
tab_ tags - mark_
resolved - Mark the file as resolved (stage it) after manual edits.
- remote_
add - Add a new git remote.
- remote_
delete - Delete an existing git remote.
- resolve_
conflict_ hunk - Resolve a specific conflict hunk inside a file (Ours vs Theirs).
Replaces the hunk at index
hunk_idxin the file on disk. If no more conflicts remain in the file, it automatically stages the file. - resolve_
ours - Accept the OURS (HEAD) version of a conflicted file.
Equivalent to: git checkout –ours
&& git add - resolve_
theirs - Accept the THEIRS (incoming) version of a conflicted file.
Equivalent to: git checkout –theirs
&& git add - save_
stash - serialize_
tags - stage_
all_ changes - Stage all unstaged/untracked changes (equivalent to
git add -A). - stage_
file - Add
file_pathto the index (equivalent togit add <file>). Returns a human-readable error string on failure. - stage_
hunk - Stage a single hunk of unstaged changes (equivalent to
git apply --cached -). - stage_
line - Stage a single line from the Unstaged diff.
- unstage_
all_ changes - Unstage all staged changes (equivalent to
git reset). - unstage_
file - Remove
file_pathfrom the index (equivalent togit restore --staged <file>). When HEAD exists the index entry is reset to the HEAD tree value; for a brand-new repo with no commits the entry is simply removed from the index. Returns a human-readable error string on failure. - unstage_
hunk - Unstage a single hunk of staged changes (equivalent to
git apply --cached --reverse -). - unstage_
line - Unstage a single line from the Staged diff.