Expand description
Unified RefUpdateGate for all server-side Git ref mutations.
Enforces per-repository in-process + cross-process serialization (arks-ref-gate.lock),
internal refs/arks/* confidentiality, archived repository immutability, branch
protection rules (block_delete, block_force_push),
PushPolicy, non-bare checkout safety
(receive.denyCurrentBranch), Git receive hooks (pre-receive, update,
post-receive, post-update), atomic CAS ref mutation, dumb HTTP info/refs
refresh, webhooks, and Actions CI.
Spec: .spec/sot/arks-self-host-server.sot.md §38–§43.
Structs§
- Gated
RefUpdate - Canonical description of one server-side ref create, update, or delete.
- RefGate
Guard - RAII lock guard serializing ref updates per repository across both threads
(via an
Arc-backed slot map with zeroBox::leak) and OS processes (via sibling lockfile<common_dir>/arks-ref-gate.lock).
Enums§
- Gate
Reject - Structured rejection reason returned by
RefUpdateGate.
Functions§
- acquire_
repo_ ref_ lock - Acquire the per-repository serialization lock (both in-process and cross-process
<common_dir>/arks-ref-gate.lock). - apply_
gated_ ref_ update - Apply a single gated ref update acquiring the per-repository
RefGateGuard. DropsRefGateGuardBEFORE dispatching synchronous webhooks and CI workflows. - apply_
gated_ ref_ update_ locked - Apply a single gated ref update when the caller already holds
RefGateGuardforrepo.common_dir(). Executes only lock-scoped effects (update_server_info); callers needing external webhooks/CI should invoke [post_receive_external_effects] after droppingguard. - check_
non_ bare_ deny_ current_ branch - Check non-bare checkout safety per
receive.denyCurrentBranch/receive.denyDeleteCurrent. - enforce_
branch_ rules_ and_ policy - Enforce internal ref isolation, archived-repo immutability,
ForgeStore.branch_rules(block_delete,block_force_push), non-ff rules, and the installed process-widePushPolicy. - post_
receive_ side_ effects - Shared post-receive side effects combining lock-scoped repository refreshes and external notifications: