2012-11-07 17:11:45 -07:00
|
|
|
#include <string.h>
|
2012-03-14 16:33:35 -06:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2012-11-07 17:11:45 -07:00
|
|
|
#define GIT_PROJECT_ROOT "/home/neale/projects"
|
|
|
|
#define CGIT_CONFIG "/home/neale/public_html/cgitrc"
|
|
|
|
|
2012-03-14 16:33:35 -06:00
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
2012-11-07 17:11:45 -07:00
|
|
|
char *uri = getenv("REQUEST_URI");
|
|
|
|
|
|
|
|
if (uri && strstr(uri, "git-upload-pack")) {
|
|
|
|
/* Use git-http-backend for great speed! */
|
|
|
|
setenv("GIT_PROJECT_ROOT", GIT_PROJECT_ROOT, 1);
|
|
|
|
execlp("git", "git", "http-backend", NULL);
|
|
|
|
} else {
|
|
|
|
setenv("CGIT_CONFIG", CGIT_CONFIG, 1);
|
|
|
|
execl("/usr/local/bin/cgit", "cgit", NULL);
|
|
|
|
}
|
2012-03-14 16:33:35 -06:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|