| 1713 | } |
| 1714 | |
| 1715 | int 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, "//"); |
nothing calls this directly
no test coverage detected