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

Function do_exec

sequencer.c:3863–3905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3861}
3862
3863static int do_exec(struct repository *r, const char *command_line, int quiet)
3864{
3865 struct child_process cmd = CHILD_PROCESS_INIT;
3866 int dirty, status;
3867
3868 if (!quiet)
3869 fprintf(stderr, _("Executing: %s\n"), command_line);
3870 cmd.use_shell = 1;
3871 strvec_push(&cmd.args, command_line);
3872 strvec_push(&cmd.env, "GIT_CHERRY_PICK_HELP");
3873 status = run_command(&cmd);
3874
3875 /* force re-reading of the cache */
3876 discard_index(r->index);
3877 if (repo_read_index(r) < 0)
3878 return error(_("could not read index"));
3879
3880 dirty = require_clean_work_tree(r, "rebase", NULL, 1, 1);
3881
3882 if (status) {
3883 warning(_("execution failed: %s\n%s"
3884 "You can fix the problem, and then run\n"
3885 "\n"
3886 " git rebase --continue\n"
3887 "\n"),
3888 command_line,
3889 dirty ? _("and made changes to the index and/or the "
3890 "working tree.\n") : "");
3891 if (status == 127)
3892 /* command not found */
3893 status = 1;
3894 } else if (dirty) {
3895 warning(_("execution succeeded: %s\nbut "
3896 "left changes to the index and/or the working tree.\n"
3897 "Commit or stash your changes, and then run\n"
3898 "\n"
3899 " git rebase --continue\n"
3900 "\n"), command_line);
3901 status = 1;
3902 }
3903
3904 return status;
3905}
3906
3907__attribute__((format (printf, 2, 3)))
3908static int safe_append(const char *filename, const char *fmt, ...)

Callers 1

pick_commitsFunction · 0.85

Calls 7

strvec_pushFunction · 0.85
run_commandFunction · 0.85
discard_indexFunction · 0.85
repo_read_indexFunction · 0.85
errorFunction · 0.85
require_clean_work_treeFunction · 0.85
warningFunction · 0.85

Tested by

no test coverage detected