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

Function execute_commands

builtin/receive-pack.c:2028–2140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2026}
2027
2028static void execute_commands(struct command *commands,
2029 const char *unpacker_error,
2030 struct shallow_info *si,
2031 const struct string_list *push_options)
2032{
2033 struct check_connected_options opt = CHECK_CONNECTED_INIT;
2034 struct command *cmd;
2035 struct iterate_data data;
2036 struct async muxer;
2037 int err_fd = 0;
2038 int run_proc_receive = 0;
2039
2040 if (unpacker_error) {
2041 for (cmd = commands; cmd; cmd = cmd->next)
2042 cmd->error_string = "unpacker error";
2043 return;
2044 }
2045
2046 if (!skip_connectivity_check) {
2047 if (use_sideband) {
2048 memset(&muxer, 0, sizeof(muxer));
2049 muxer.proc = copy_to_sideband;
2050 muxer.in = -1;
2051 if (!start_async(&muxer))
2052 err_fd = muxer.in;
2053 /* ...else, continue without relaying sideband */
2054 }
2055
2056 data.cmds = commands;
2057 data.si = si;
2058 opt.err_fd = err_fd;
2059 opt.progress = err_fd && !quiet;
2060 opt.env = tmp_objdir_env(tmp_objdir);
2061 opt.exclude_hidden_refs_section = "receive";
2062
2063 if (check_connected(iterate_receive_command_list, &data, &opt))
2064 set_connectivity_errors(commands, si);
2065
2066 if (use_sideband)
2067 finish_async(&muxer);
2068 }
2069
2070 reject_updates_to_hidden(commands);
2071
2072 /*
2073 * Try to find commands that have special prefix in their reference names,
2074 * and mark them to run an external "proc-receive" hook later.
2075 */
2076 if (proc_receive_ref) {
2077 for (cmd = commands; cmd; cmd = cmd->next) {
2078 if (!should_process_cmd(cmd))
2079 continue;
2080
2081 if (proc_receive_ref_matches(cmd)) {
2082 cmd->run_proc_receive = RUN_PROC_RECEIVE_SCHEDULED;
2083 run_proc_receive = 1;
2084 }
2085 }

Callers 1

cmd_receive_packFunction · 0.85

Calls 15

start_asyncFunction · 0.85
tmp_objdir_envFunction · 0.85
check_connectedFunction · 0.85
set_connectivity_errorsFunction · 0.85
finish_asyncFunction · 0.85
reject_updates_to_hiddenFunction · 0.85
should_process_cmdFunction · 0.85
proc_receive_ref_matchesFunction · 0.85
run_receive_hookFunction · 0.85
tmp_objdir_migrateFunction · 0.85
check_aliased_updatesFunction · 0.85
refs_resolve_refdupFunction · 0.85

Tested by

no test coverage detected