@matheusbsbs / matheus-bagliano / commits / 74c0cc21a5
Fork 0

daemon: add upload-tar service.

This allows clients to ask for tarballs with: git tar-tree --remote=git://server/repo refname By default, the upload-tar service is not enabled. To enable it server-wide, the server can be started with: git-daemon --enable=upload-tar This service is by default overridable per repostiory, so alternatively, a repository can define "daemon.uploadtar = true" to enable it. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Aug 20, 2006 at 19:03 UTC 74c0cc21a57a15bbce46ee02bc882064ee9bcf6b
1 file changed +11 -4
daemon.c
+11 -4
@@ -324,8 +324,15 @@ static int upload_pack(void)
324 return -1;
325 }
326
327 +static int upload_tar(void)
328 +{
329 + execl_git_cmd("upload-tar", ".", NULL);
330 + return -1;
331 +}
332 +
333 static struct daemon_service daemon_service[] = {
334 { "upload-pack", "uploadpack", upload_pack, 1, 1 },
335 + { "upload-tar", "uploadtar", upload_tar, 0, 1 },
336 };
337
338 static void enable_service(const char *name, int ena) {
@@ -896,12 +903,12 @@ int main(int argc, char **argv)
903 enable_service(arg + 10, 0);
904 continue;
905 }
899 - if (!strncmp(arg, "--enable-override=", 18)) {
900 - make_service_overridable(arg + 18, 1);
906 + if (!strncmp(arg, "--allow-override=", 17)) {
907 + make_service_overridable(arg + 17, 1);
908 continue;
909 }
903 - if (!strncmp(arg, "--disable-override=", 19)) {
904 - make_service_overridable(arg + 19, 0);
910 + if (!strncmp(arg, "--forbid-override=", 18)) {
911 + make_service_overridable(arg + 18, 0);
912 continue;
913 }
914 if (!strcmp(arg, "--")) {