MCPcopy Create free account
hub / github.com/git/git / do_push

Function do_push

builtin/push.c:420–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418}
419
420static 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
450static int option_parse_recurse_submodules(const struct option *opt,
451 const char *arg, int unset)

Callers 1

cmd_pushFunction · 0.85

Calls 4

push_url_of_remoteFunction · 0.85
transport_getFunction · 0.85
push_with_optionsFunction · 0.85

Tested by

no test coverage detected