Expand description
Git plumbing: keep a bare mirror fresh and serve upload-pack from it.
All git work is delegated to the system git binary, so protocol
correctness - including protocol v2, shallow and partial (filtered) clones -
comes for free. The proxy never reimplements the wire format; it only:
- maps a request to a bare mirror under the cache root,
- runs an incremental
git fetchfrom upstream (coalesced per repo), - streams
git upload-packoutput from the local mirror to the client.
It is strictly read-only: only git-upload-pack (clone/fetch) is served, and
upstream is only ever pulled from - nothing is pushed or replicated
proactively. A miss transparently pulls from upstream, so the cache is never
stale for the ref the client actually asked for.
Structs§
- GitCache
- GitConfig
- Timed
Reader - Wraps
upload-pack’s stdout to record how long the packfile took to serve. The duration spans from the RPC starting to the stream reaching EOF - or the client disconnecting, caught byDrop- so it includes the client’s read speed: this is serve latency, not pure generation time. Recorded exactly once (theOptionistaken on the first of EOF or drop).
Enums§
- Cache
Outcome - What
ensure_freshdid - for metrics.