aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-08-20 19:03:50 -0700
committerJunio C Hamano <junkio@cox.net>2006-08-27 23:32:37 -0700
commit74c0cc21a57a15bbce46ee02bc882064ee9bcf6b (patch)
treea35604e54963bef335c1990e891dcb3bf335457b
parentd819e4e682d68ca41378e4352b9e2bba084971dc (diff)
downloadgit-74c0cc21a57a15bbce46ee02bc882064ee9bcf6b.tar.gz
git-74c0cc21a57a15bbce46ee02bc882064ee9bcf6b.tar.xz
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>
-rw-r--r--daemon.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/daemon.c b/daemon.c
index e430cfbc8..a4a08f39d 100644
--- a/daemon.c
+++ b/daemon.c
@@ -324,8 +324,15 @@ static int upload_pack(void)
return -1;
}
+static int upload_tar(void)
+{
+ execl_git_cmd("upload-tar", ".", NULL);
+ return -1;
+}
+
static struct daemon_service daemon_service[] = {
{ "upload-pack", "uploadpack", upload_pack, 1, 1 },
+ { "upload-tar", "uploadtar", upload_tar, 0, 1 },
};
static void enable_service(const char *name, int ena) {
@@ -896,12 +903,12 @@ int main(int argc, char **argv)
enable_service(arg + 10, 0);
continue;
}
- if (!strncmp(arg, "--enable-override=", 18)) {
- make_service_overridable(arg + 18, 1);
+ if (!strncmp(arg, "--allow-override=", 17)) {
+ make_service_overridable(arg + 17, 1);
continue;
}
- if (!strncmp(arg, "--disable-override=", 19)) {
- make_service_overridable(arg + 19, 0);
+ if (!strncmp(arg, "--forbid-override=", 18)) {
+ make_service_overridable(arg + 18, 0);
continue;
}
if (!strcmp(arg, "--")) {