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

Function run_commit_hook

commit.c:1994–2016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1992}
1993
1994int run_commit_hook(int editor_is_used, const char *index_file,
1995 int *invoked_hook, const char *name, ...)
1996{
1997 struct run_hooks_opt opt = RUN_HOOKS_OPT_INIT_FORCE_SERIAL;
1998 va_list args;
1999 const char *arg;
2000
2001 strvec_pushf(&opt.env, "GIT_INDEX_FILE=%s", index_file);
2002
2003 /*
2004 * Let the hook know that no editor will be launched.
2005 */
2006 if (!editor_is_used)
2007 strvec_push(&opt.env, "GIT_EDITOR=:");
2008
2009 va_start(args, name);
2010 while ((arg = va_arg(args, const char *)))
2011 strvec_push(&opt.args, arg);
2012 va_end(args);
2013
2014 opt.invoked_hook = invoked_hook;
2015 return run_hooks_opt(the_repository, name, &opt);
2016}
2017
2018void commit_stack_init(struct commit_stack *stack)
2019{

Callers 5

try_to_commitFunction · 0.85
prepare_to_commitFunction · 0.85
prepare_to_commitFunction · 0.85
cmd_commitFunction · 0.85

Calls 3

strvec_pushfFunction · 0.85
strvec_pushFunction · 0.85
run_hooks_optClass · 0.70

Tested by

no test coverage detected