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

Function cmd_send_pack

builtin/send-pack.c:151–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151int cmd_send_pack(int argc,
152 const char **argv,
153 const char *prefix,
154 struct repository *repo)
155{
156 struct refspec rs = REFSPEC_INIT_PUSH;
157 const char *remote_name = NULL;
158 struct remote *remote = NULL;
159 const char *dest = NULL;
160 int fd[2];
161 struct child_process *conn;
162 struct oid_array extra_have = OID_ARRAY_INIT;
163 struct oid_array shallow = OID_ARRAY_INIT;
164 struct ref *remote_refs, *local_refs;
165 int ret;
166 int helper_status = 0;
167 int send_all = 0;
168 int verbose = 0;
169 const char *receivepack = "git-receive-pack";
170 unsigned dry_run = 0;
171 unsigned send_mirror = 0;
172 unsigned force_update = 0;
173 unsigned quiet = 0;
174 int push_cert = 0;
175 struct string_list push_options = STRING_LIST_INIT_NODUP;
176 unsigned use_thin_pack = 0;
177 unsigned atomic = 0;
178 unsigned stateless_rpc = 0;
179 int flags;
180 unsigned int reject_reasons;
181 int progress = -1;
182 int from_stdin = 0;
183 struct push_cas_option cas = {0};
184 int force_if_includes = 0;
185 struct packet_reader reader;
186
187 struct option options[] = {
188 OPT__VERBOSITY(&verbose),
189 OPT_STRING(0, "receive-pack", &receivepack, "receive-pack", N_("receive pack program")),
190 OPT_STRING(0, "exec", &receivepack, "receive-pack", N_("receive pack program")),
191 OPT_STRING(0, "remote", &remote_name, "remote", N_("remote name")),
192 OPT_BOOL(0, "all", &send_all, N_("push all refs")),
193 OPT_BOOL('n' , "dry-run", &dry_run, N_("dry run")),
194 OPT_BOOL(0, "mirror", &send_mirror, N_("mirror all refs")),
195 OPT_BOOL('f', "force", &force_update, N_("force updates")),
196 OPT_CALLBACK_F(0, "signed", &push_cert, "(yes|no|if-asked)", N_("GPG sign the push"),
197 PARSE_OPT_OPTARG, option_parse_push_signed),
198 OPT_STRING_LIST(0, "push-option", &push_options,
199 N_("server-specific"),
200 N_("option to transmit")),
201 OPT_BOOL(0, "progress", &progress, N_("force progress reporting")),
202 OPT_BOOL(0, "thin", &use_thin_pack, N_("use thin pack")),
203 OPT_BOOL(0, "atomic", &atomic, N_("request atomic transaction on remote side")),
204 OPT_BOOL(0, "stateless-rpc", &stateless_rpc, N_("use stateless RPC protocol")),
205 OPT_BOOL(0, "stdin", &from_stdin, N_("read refs from stdin")),
206 OPT_BOOL(0, "helper-status", &helper_status, N_("print status from remote helper")),
207 OPT_CALLBACK_F(0, "force-with-lease", &cas, N_("<refname>:<expect>"),
208 N_("require old value of ref to be at this value"),

Callers

nothing calls this directly

Calls 15

parse_optionsFunction · 0.85
refspec_appendnFunction · 0.85
usage_with_optionsFunction · 0.85
packet_read_lineFunction · 0.85
refspec_appendFunction · 0.85
strbuf_getlineFunction · 0.85
strbuf_releaseFunction · 0.85
remote_getFunction · 0.85
remote_has_urlFunction · 0.85
git_connectFunction · 0.85
packet_reader_initFunction · 0.85
discover_versionFunction · 0.85

Tested by

no test coverage detected