Documentation
¶
Overview ¶
Package gittransport carries the shared HTTPS-transport install lock serialized across git.Fetcher and the bare-mirror cache.
go-git v5 has no per-CloneOptions TLS hook, so a custom-CA fetch must register its transport on go-git's process-global protocol map and restore the default afterward. The lock is package-global because the install itself is — a per-Fetcher mutex would race when two Fetchers ran concurrently and clobbered each other's transport.
At init flate installs a *bounded* HTTPS client as go-git's process default (source.NewHTTPTransport carries ResponseHeaderTimeout) so an anonymous git fetch against a host that black-holes after dial can't hang the run — the consumer's dependency wait is now bound to fetch completion, not a wall clock. Anonymous fetches use this default concurrently with no per-fetch lock; custom-CA fetches swap in their own bounded transport under mu and restore to this bounded default (not go-git's unbounded githttp.DefaultClient).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallHTTPS ¶
func InstallHTTPS(tlsCfg *tls.Config, proxy *source.ProxyConfig) (func(), error)
InstallHTTPS acquires the process-global mutex, installs a custom HTTPS transport on go-git's protocol map, and returns a restore func the caller MUST defer.
sync.OnceFunc prevents a double-restore (defer + explicit call) from unlocking an already-unlocked mutex. When tlsCfg is nil there is nothing to customize — returns a no-op without acquiring the lock.
Types ¶
This section is empty.