| 418 | } |
| 419 | |
| 420 | static int do_push(int flags, |
| 421 | const struct string_list *push_options, |
| 422 | struct remote *remote) |
| 423 | { |
| 424 | int errs; |
| 425 | struct strvec *url; |
| 426 | struct refspec *push_refspec = &rs; |
| 427 | |
| 428 | if (push_options->nr) |
| 429 | flags |= TRANSPORT_PUSH_OPTIONS; |
| 430 | |
| 431 | if (!push_refspec->nr && !(flags & TRANSPORT_PUSH_ALL)) { |
| 432 | if (remote->push.nr) { |
| 433 | push_refspec = &remote->push; |
| 434 | } else if (!(flags & TRANSPORT_PUSH_MIRROR)) |
| 435 | setup_default_push_refspecs(&flags, remote); |
| 436 | } |
| 437 | errs = 0; |
| 438 | url = push_url_of_remote(remote); |
| 439 | for (size_t i = 0; i < url->nr; i++) { |
| 440 | struct transport *transport = |
| 441 | transport_get(remote, url->v[i]); |
| 442 | if (flags & TRANSPORT_PUSH_OPTIONS) |
| 443 | transport->push_options = push_options; |
| 444 | if (push_with_options(transport, push_refspec, flags)) |
| 445 | errs++; |
| 446 | } |
| 447 | return !!errs; |
| 448 | } |
| 449 | |
| 450 | static int option_parse_recurse_submodules(const struct option *opt, |
| 451 | const char *arg, int unset) |
no test coverage detected