Skip to main content

Module service

Module service 

Source
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 walks GIT_PROJECT_ROOT + PATH_INFO internally.
  • GIT_HTTP_EXPORT_ALL set (empty value, just defined) so all repos under the root are read-exportable.
  • GIT_HTTP_RECEIVE_PACK=true so push is enabled (JSS line 157).
  • GIT_CONFIG_PARAMETERS injects uploadpack.allowTipSHA1InWant to match JSS line 158.
  • For non-bare repos we set GIT_DIR to the .git child (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 first Status: header into the HTTP response status.

Structs§

GitHttpService
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_PATH env var at service-startup time (the default matches Debian/Ubuntu).