提交 b226293b 编写于 作者: R René Scharfe 提交者: Junio C Hamano

trailer: use CHILD_PROCESS_INIT in apply_command()

Initialize the struct child_process variable cp at declaration time.
This is shorter, saves a function call and prevents using the variable
before initialization by mistake.
Suggested-by: NJeff King <peff@peff.net>
Signed-off-by: NRene Scharfe <l.s.r@web.de>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 66edfe9d
......@@ -228,7 +228,7 @@ static const char *apply_command(const char *command, const char *arg)
{
struct strbuf cmd = STRBUF_INIT;
struct strbuf buf = STRBUF_INIT;
struct child_process cp;
struct child_process cp = CHILD_PROCESS_INIT;
const char *argv[] = {NULL, NULL};
const char *result;
......@@ -237,7 +237,6 @@ static const char *apply_command(const char *command, const char *arg)
strbuf_replace(&cmd, TRAILER_ARG_STRING, arg);
argv[0] = cmd.buf;
child_process_init(&cp);
cp.argv = argv;
cp.env = local_repo_env;
cp.no_stdin = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册