Skip to main content

Module git

Module git 

Source
Expand description

Native git operations layered on top of gix.

Operations that gix 0.82 exposes go through gix natively; config reads/writes go through gix-config + gix-lock for atomic edits parity with git config. Bundle creation and consumption use the native gix-pack-based implementation in [crate::bundle]; no git subprocess is spawned at runtime.

Structs§

RefName
Validated git ref name — guaranteed to satisfy gix_validate::reference::name (the strict, fully-qualified form).
Sha
SHA-1 object OID, displayed as 40 lowercase hex characters.

Enums§

GitError
Aggregate error for the helpers in this module.
RefNameError
Error returned by RefName::new.
ShaError
Error returned by Sha::from_hex.

Functions§

archive
Write a zip archive of the tree at spec to <folder>/repo.zip and return the path.
bundle
Write a git bundle for spec to <folder>/<sha>.bundle and return the absolute path.
bundle_at
Path-only variant of bundle for callers that cannot hold a &Repository across .await (the protocol push handler shares state across tokio tasks; gix::Repository is !Sync, so its future would not be Send).
config_add
Add a multi-value entry to the repository’s local config (<section>[.<subsection>].<name> = value).
config_add_many
Batched variant of config_add: applies every (key, value) entry to the local config in a single read / parse / lock / write cycle.
config_set
Set a single-value entry in the repository’s local config, replacing any existing values for the key.
config_set_many
Batched variant of config_set: applies every (key, value) entry to the local config in a single read / parse / lock / write cycle.
config_unset
Remove the latest value for the given key from the repository’s local config.
config_unset_if_present
Idempotent variant of config_unset: succeeds even when the key is already absent.
is_ancestor
Return true iff ancestor is an ancestor of descendant (or equals it).
is_valid_ref_name
Permissive ref-name predicate.
last_commit_message
Format HEAD’s commit as "<short-sha> <subject>", matching upstream git log -1 --pretty=%h %s. Used as CodePipeline metadata in the s3+zip push variant.
remote_url
Read a remote’s URL out of the repository’s configuration.
unbundle
Unbundle <folder>/<sha>.bundle into repo.
unbundle_at
Path-only variant of unbundle for callers that cannot hold a &Repository across .await (notably the parallel fetch handler: gix::Repository is !Sync, so it cannot be shared across concurrent tasks).