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

Function run_prepare_commit_msg_hook

sequencer.c:1348–1370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1346}
1347
1348static int run_prepare_commit_msg_hook(struct repository *r,
1349 struct strbuf *msg,
1350 const char *commit)
1351{
1352 int ret = 0;
1353 const char *name, *arg1 = NULL, *arg2 = NULL;
1354
1355 name = git_path_commit_editmsg();
1356 if (write_message(msg->buf, msg->len, name, 0))
1357 return -1;
1358
1359 if (commit) {
1360 arg1 = "commit";
1361 arg2 = commit;
1362 } else {
1363 arg1 = "message";
1364 }
1365 if (run_commit_hook(0, r->index_file, NULL, "prepare-commit-msg", name,
1366 arg1, arg2, NULL))
1367 ret = error(_("'prepare-commit-msg' hook failed"));
1368
1369 return ret;
1370}
1371
1372static const char implicit_ident_advice_noconfig[] =
1373N_("Your name and email address were configured automatically based\n"

Callers 1

try_to_commitFunction · 0.85

Calls 3

write_messageFunction · 0.85
run_commit_hookFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected