| 1992 | } |
| 1993 | |
| 1994 | int 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 | |
| 2018 | void commit_stack_init(struct commit_stack *stack) |
| 2019 | { |
no test coverage detected