Skip to main content

Module api

Module api 

Source
Expand description

High-level git control-panel operations for a pod’s git repository.

Each function shells out to the git binary via tokio::process::Command. All functions take repo: &Path — the absolute filesystem path to the pod’s git repository (i.e. data_root/{pubkey}).

These are wired to REST endpoints in solid-pod-rs-server behind #[cfg(feature = "git")].

Structs§

BranchInfo
Current branch state.
CommitEntry
A single commit log entry.
CommitResult
Result of a successful commit.
FileStatus
A single file entry in the status report.
StatusReport
Full status report for a repository.

Enums§

ChangeType
Type of change reported by git status.

Functions§

git_add
Stage files. If all is true, runs git add -A. Otherwise stages only the listed paths.
git_branches
Return the list of local branches and identify the current one.
git_commit
Create a commit with the given message. Returns the new commit hash and a one-line summary.
git_create_branch
Create and switch to a new branch called name.
git_diff
Return a unified diff for the repository or a specific file.
git_discard
Discard working-tree changes to the listed paths (equivalent to git checkout -- <paths>).
git_log
Return the commit log for repo, up to limit entries (capped at 100).
git_status
Return the working-tree and index status of repo.
git_unstage
Unstage files. If all is true, unstages everything. Otherwise unstages only the listed paths.
parse_status_output
Pure-function status parser — split out for unit-testing.