MCPcopy Index your code
hub / github.com/git/git / cmd_main

Function cmd_main

http-push.c:1715–2011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1713}
1714
1715int cmd_main(int argc, const char **argv)
1716{
1717 struct transfer_request *request;
1718 struct transfer_request *next_request;
1719 struct refspec rs = REFSPEC_INIT_PUSH;
1720 struct remote_lock *ref_lock = NULL;
1721 struct remote_lock *info_ref_lock = NULL;
1722 int delete_branch = 0;
1723 int force_delete = 0;
1724 int objects_to_send;
1725 int rc = 0;
1726 int i;
1727 int new_refs;
1728 struct ref *ref, *local_refs = NULL;
1729 const char *gitdir;
1730
1731 CALLOC_ARRAY(repo, 1);
1732
1733 argv++;
1734 for (i = 1; i < argc; i++, argv++) {
1735 const char *arg = *argv;
1736
1737 if (*arg == '-') {
1738 if (!strcmp(arg, "--all")) {
1739 push_all = MATCH_REFS_ALL;
1740 continue;
1741 }
1742 if (!strcmp(arg, "--force")) {
1743 force_all = 1;
1744 continue;
1745 }
1746 if (!strcmp(arg, "--dry-run")) {
1747 dry_run = 1;
1748 continue;
1749 }
1750 if (!strcmp(arg, "--helper-status")) {
1751 helper_status = 1;
1752 continue;
1753 }
1754 if (!strcmp(arg, "--verbose")) {
1755 push_verbosely = 1;
1756 http_is_verbose = 1;
1757 continue;
1758 }
1759 if (!strcmp(arg, "-d")) {
1760 delete_branch = 1;
1761 continue;
1762 }
1763 if (!strcmp(arg, "-D")) {
1764 delete_branch = 1;
1765 force_delete = 1;
1766 continue;
1767 }
1768 if (!strcmp(arg, "-h"))
1769 usage(http_push_usage);
1770 }
1771 if (!repo->url) {
1772 const char *path = strstr(arg, "//");

Callers

nothing calls this directly

Calls 15

str_end_url_with_slashFunction · 0.85
refspec_appendnFunction · 0.85
setup_git_directoryFunction · 0.85
http_initFunction · 0.85
locking_availableFunction · 0.85
sigchain_push_commonFunction · 0.85
remote_existsFunction · 0.85
lock_remoteFunction · 0.85
errorFunction · 0.85
get_local_headsFunction · 0.85
get_dav_remote_headsFunction · 0.85
run_request_queueFunction · 0.85

Tested by

no test coverage detected