Skip to main content

commit_ref_store_batch

Function commit_ref_store_batch 

Source
pub fn commit_ref_store_batch(
    git_dir: &Path,
    updates: &[RefUpdate],
) -> Result<()>
Expand description

Apply several ref updates in one RefStore::prepare / commit (all-or-nothing).

Opens a fresh on-disk ref store for git_dir (object-checked open used internally) and bypasses crate::repo::Repository::refs and any injected crate::refs::store::RefStore. Prefer commit_ref_updates_on_store with crate::repo::Repository::refs when you already have a crate::repo::Repository.

Used by batch ref paths (fetch, push, receive-pack, crate::gc::update_refs). Like crate::repo::Repository::refs, the batch is checked against git_dir’s objects first.

§Errors

Returns crate::refs::store::RefStoreError for duplicate names, CAS failures, lock conflicts, namespace conflicts, and direct values naming a missing object (MissingObject) or, on a branch or HEAD, a non-commit (NotACommit). Propagates I/O and corrupt-store failures.