static int do_push(const char *repo)
{
const char *uri[MAX_URI];
- int i, n;
+ int i, n, errs;
int common_argc;
const char **argv;
int argc;
argv[argc++] = receivepack;
common_argc = argc;
+ errs = 0;
for (i = 0; i < n; i++) {
int err;
int dest_argc = common_argc;
int dest_refspec_nr = refspec_nr;
const char **dest_refspec = refspec;
const char *dest = uri[i];
- const char *sender = "git-send-pack";
+ const char *sender = "send-pack";
if (!prefixcmp(dest, "http://") ||
!prefixcmp(dest, "https://"))
- sender = "git-http-push";
+ sender = "http-push";
else if (thin)
argv[dest_argc++] = "--thin";
argv[0] = sender;
argv[dest_argc] = NULL;
if (verbose)
fprintf(stderr, "Pushing to %s\n", dest);
- err = run_command_v(argv);
+ err = run_command_v_opt(argv, RUN_GIT_CMD);
if (!err)
continue;
+
+ error("failed to push to '%s'", uri[i]);
switch (err) {
case -ERR_RUN_COMMAND_FORK:
- die("unable to fork for %s", sender);
+ error("unable to fork for %s", sender);
case -ERR_RUN_COMMAND_EXEC:
- die("unable to exec %s", sender);
+ error("unable to exec %s", sender);
+ break;
case -ERR_RUN_COMMAND_WAITPID:
case -ERR_RUN_COMMAND_WAITPID_WRONG_PID:
case -ERR_RUN_COMMAND_WAITPID_SIGNAL:
case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
- die("%s died with strange error", sender);
- default:
- return -err;
+ error("%s died with strange error", sender);
}
+ errs++;
}
- return 0;
+ return !!errs;
}
int cmd_push(int argc, const char **argv, const char *prefix)