Skip to main content

Module git

Module git 

Source
Expand description

Git operations using system git command.

All functions shell out to git via std::process::Command. This eliminates the heavy gix dependency and works with any git transport (including dumb HTTP).

Structs§

GitSizeLimits
Disk budget for cloned/fetched git repositories.
GitSizeStats

Enums§

GitError
Error type for git operations.

Constants§

CMN_PROMISOR_REMOTE
GIT_COMMAND_TIMEOUT
Default wall-clock limit for every system git invocation.

Functions§

add_all_and_commit
Add all files and create a commit. Returns the commit SHA.
add_remote
Add a remote to the repository.
checkout_ref
Checkout a specific ref (commit SHA, tag, or branch).
clone_bare_repo
Clone a git repository as a bare repository.
clone_from_local
Clone from a local bare repository to a working directory.
clone_from_local_no_checkout
Clone from a local bare repository without checking out files.
clone_repo
Clone a git repository to the specified destination.
commit_exists
Check if a commit exists in the repository.
configure_blobless_origin
Configure origin as a blobless promisor remote for lazy blob fetching.
configure_blobless_promisor_remote
Configure a blobless promisor remote for lazy blob fetching.
enforce_size_budget
Walk a git checkout/cache path without following symlinks and enforce disk limits.
fetch_from_remote
Fetch from a named remote in the repository.
fetch_to_bare
Fetch from a remote URL into a bare repository.
get_head_commit
Get the current HEAD commit ID as a string.
get_remote_url
Get the URL of a named remote, or None if the remote doesn’t exist.
get_root_commit
Get the root commit SHA (first commit in history) from a working directory.
get_root_commit_bare
Get the root commit from a bare repository.
init_repo
Initialize a new git repository at the given path.
is_available
Check if system git is available.
is_working_dir_clean
Check if the working directory has uncommitted changes.
last_commit_epoch_ms
Get the latest git commit timestamp for a path, if the path is in a repo.
set_remote_url
Set the URL for an existing remote.