Expand description
Binder-agnostic Git HTTP service — spawns the system
git http-backend CGI and shuttles stdin/stdout between it and
the HTTP layer.
Mirrors JSS src/handlers/git.js lines 95-268 (handleGit) end
to end. The key design choices, all pulled straight from JSS:
GIT_PROJECT_ROOT = repo_root,PATH_INFO = request path. The CGI walksGIT_PROJECT_ROOT + PATH_INFOinternally.GIT_HTTP_EXPORT_ALLset (empty value, just defined) so all repos under the root are read-exportable.GIT_HTTP_RECEIVE_PACK=trueso push is enabled (JSS line 157).GIT_CONFIG_PARAMETERSinjectsuploadpack.allowTipSHA1InWantto match JSS line 158.- For non-bare repos we set
GIT_DIRto the.gitchild (JSS lines 168-170). - We parse CGI headers from stdout, separate them from body on
\r\n\r\n(fall back to\n\n), and convert the firstStatus:header into the HTTP response status.
Structs§
- GitHttp
Service - The Git HTTP service.
- GitRequest
- Opaque HTTP request shape consumed by the service.
- GitResponse
- CGI response to return to the HTTP layer.
Constants§
- DEFAULT_
GIT_ HTTP_ BACKEND - Path to the CGI binary shipped with git. Configurable via
GIT_HTTP_BACKEND_PATHenv var at service-startup time (the default matches Debian/Ubuntu).