Skip to main content

Module repo

Module repo 

Source
Expand description

Request-path -> (upstream URL, on-disk cache dir) resolution, hardened against path traversal.

Structs§

RepoRef
A resolved repository: where to fetch it from and where it is cached.

Constants§

EVICTING_SUFFIX
Reserved suffix for the trash directory a mirror is renamed to during eviction before its (possibly slow) removal (see git::GitCache::evict). Reserved for the same reason as INCOMING_SUFFIX: a client path must never alias a mirror mid-eviction.
INCOMING_SUFFIX
Reserved suffix for the staging directory a mirror is cloned into before its atomic rename into place (see git::clone_mirror). resolve rejects any client path containing it, so a request can never resolve onto another repo’s in-flight clone directory.

Functions§

repo_name_from_path
Strip a smart-HTTP endpoint suffix (/info/refs, /git-upload-pack) from a request path and return the repo name. None if the suffix isn’t present.
resolve
Validate a repo path (no traversal / absolute / NUL) and resolve it against the upstream base and cache root.