Skip to main content

Module git

Module git 

Source
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:

  1. maps a request to a bare mirror under the cache root,
  2. runs an incremental git fetch from upstream (coalesced per repo),
  3. streams git upload-pack output 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

Enums§

CacheOutcome
What ensure_fresh did - for metrics.