Skip to main content

Module git

Module git 

Source
Expand description

Pure-Rust git operations via gix/gitoxide (no CLI spawning, no C deps). Pure-Rust git helpers using gix (gitoxide).

Replaces all Command::new("git") process spawning with in-process library calls. Every public function in this module corresponds to a git CLI operation that was previously shelled out to.

Functions§

checkout_rev
Checkout a specific revision (commit SHA) in an already-cloned repo.
clean_worktree_rev
Fingerprint a local flake directory’s git state for eval-cache keying.
clone
Clone a remote repository into dest.
commit_all
Create an initial commit in the given repo. Adds all files in the working directory and commits them.
head_rev
Get the full commit hash of HEAD (equivalent to git rev-parse HEAD).
head_timestamp
Get the committer timestamp of HEAD in seconds since epoch (equivalent to git log -1 --format=%ct).
init_repo
Initialize a new bare/non-bare git repository (for test helpers). Equivalent to git init -b <branch>.
ls_remote
List remote refs and find the commit SHA for a given ref name (equivalent to git ls-remote <url> <ref>).
rev_count
Count the number of commits reachable from HEAD (equivalent to git rev-list --count HEAD).
set_config
Set a config key in the repo’s local config.