diff --git a/send-pack.c b/send-pack.c
index c195d080db7c80420e1226f7591c9e9c3059536a..512b660e99f26e391df34d48e1aebc9c6c3250e7 100644 (file)
--- a/send-pack.c
+++ b/send-pack.c
#include "exec_cmd.h"
static const char send_pack_usage[] =
#include "exec_cmd.h"
static const char send_pack_usage[] =
-"git-send-pack [--all] [--exec=git-receive-pack] <remote> [<head>...]\n"
-" --all and explicit <head> specification are mutually exclusive.";
-static const char *exec = "git-receive-pack";
+"git-send-pack [--all] [--force] [--receive-pack=<git-receive-pack>] [--verbose] [--thin] [<host>:]<directory> [<ref>...]\n"
+" --all and explicit <ref> specification are mutually exclusive.";
+static const char *receivepack = "git-receive-pack";
static int verbose;
static int send_all;
static int force_update;
static int verbose;
static int send_all;
static int force_update;
if (pipe(pipe_fd) < 0)
return error("send-pack: pipe failed");
pid = fork();
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
if (!pid) {
/*
* The child becomes pack-objects --revs; we feed
memcpy(buf + 1, sha1_to_hex(refs->old_sha1), 40);
buf[0] = '^';
buf[41] = '\n';
memcpy(buf + 1, sha1_to_hex(refs->old_sha1), 40);
buf[0] = '^';
buf[41] = '\n';
- if (!write_in_full(pipe_fd[1], buf, 42,
+ if (!write_or_whine(pipe_fd[1], buf, 42,
"send-pack: send refs"))
break;
}
if (!is_null_sha1(refs->new_sha1)) {
memcpy(buf, sha1_to_hex(refs->new_sha1), 40);
buf[40] = '\n';
"send-pack: send refs"))
break;
}
if (!is_null_sha1(refs->new_sha1)) {
memcpy(buf, sha1_to_hex(refs->new_sha1), 40);
buf[40] = '\n';
- if (!write_in_full(pipe_fd[1], buf, 41,
+ if (!write_or_whine(pipe_fd[1], buf, 41,
"send-pack: send refs"))
break;
}
"send-pack: send refs"))
break;
}
char *arg = *argv;
if (*arg == '-') {
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")) {
continue;
}
if (!strcmp(arg, "--all")) {
usage(send_pack_usage);
verify_remote_names(nr_heads, heads);
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);
if (pid < 0)
return 1;
ret = send_pack(fd[0], fd[1], nr_heads, heads);