Skip to content

Commit

Permalink
git-push to multiple locations does not stop at the first failure
Browse files Browse the repository at this point in the history
When pushing into multiple repositories with git push, via
multiple URL in .git/remotes/$shorthand or multiple url
variables in [remote "$shorthand"] section, we used to stop upon
the first failure.  Continue the operation and report the
failure at the end.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Apr 7, 2007
1 parent 39878b0 commit fd1d1b0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions builtin-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ static int read_config(const char *repo, const char *uri[MAX_URI])
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;
Expand All @@ -317,6 +317,7 @@ static int do_push(const char *repo)
argv[argc++] = receivepack;
common_argc = argc;

errs = 0;
for (i = 0; i < n; i++) {
int err;
int dest_argc = common_argc;
Expand All @@ -343,19 +344,19 @@ static int do_push(const char *repo)
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)
Expand Down

0 comments on commit fd1d1b0

Please sign in to comment.