sequencer: simplify building argument list in do_exec()

Build child_argv during initialization, taking advantage of the C99 support for initialization expressions that are not compile time constants. This avoids the use of a magic index constant and is shorter and simpler. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Taylor Blau <me@ttaylorr.com>

René Scharfe committed Oct 30, 2022 at 12:49 UTC 242aa33de0f18bf09dd147401af9b44cf961d532
1 file changed +1 -2
sequencer.c
+1 -2
@@ -3558,11 +3558,10 @@ static int error_failed_squash(struct repository *r,
3558
3559 static int do_exec(struct repository *r, const char *command_line)
3560 {
3561 - const char *child_argv[] = { NULL, NULL };
3561 + const char *child_argv[] = { command_line, NULL };
3562 int dirty, status;
3563
3564 fprintf(stderr, _("Executing: %s\n"), command_line);
3565 - child_argv[0] = command_line;
3565 status = run_command_v_opt(child_argv, RUN_USING_SHELL);
3566
3567 /* force re-reading of the cache */