X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=send-pack.c;h=512b660e99f26e391df34d48e1aebc9c6c3250e7;hb=d81bf827192f0af6b1cca64d2cdbaac9b5ca2020;hp=6756264b293e18467a59dc0222ee82e586cda76f;hpb=240897e908e48e8f8c8d5555522afe255b3b734b;p=git.git diff --git a/send-pack.c b/send-pack.c index 6756264b2..512b660e9 100644 --- a/send-pack.c +++ b/send-pack.c @@ -6,9 +6,9 @@ #include "exec_cmd.h" static const char send_pack_usage[] = -"git-send-pack [--all] [--exec=git-receive-pack] [...]\n" -" --all and explicit specification are mutually exclusive."; -static const char *exec = "git-receive-pack"; +"git-send-pack [--all] [--force] [--receive-pack=] [--verbose] [--thin] [:] [...]\n" +" --all and explicit specification are mutually exclusive."; +static const char *receivepack = "git-receive-pack"; static int verbose; static int send_all; static int force_update; @@ -25,6 +25,8 @@ static int pack_objects(int fd, struct ref *refs) if (pipe(pipe_fd) < 0) return error("send-pack: pipe failed"); pid = fork(); + if (pid < 0) + return error("send-pack: unable to fork git-pack-objects"); if (!pid) { /* * The child becomes pack-objects --revs; we feed @@ -377,8 +379,12 @@ int main(int argc, char **argv) char *arg = *argv; if (*arg == '-') { - if (!strncmp(arg, "--exec=", 7)) { - exec = arg + 7; + if (!prefixcmp(arg, "--receive-pack=")) { + receivepack = arg + 15; + continue; + } + if (!prefixcmp(arg, "--exec=")) { + receivepack = arg + 7; continue; } if (!strcmp(arg, "--all")) { @@ -413,7 +419,7 @@ int main(int argc, char **argv) usage(send_pack_usage); verify_remote_names(nr_heads, heads); - pid = git_connect(fd, dest, exec); + pid = git_connect(fd, dest, receivepack); if (pid < 0) return 1; ret = send_pack(fd[0], fd[1], nr_heads, heads);