Skip to content

Commit 242aa33

Browse files
rscharfettaylorr
authored andcommitted
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 <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent eede29a commit 242aa33

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sequencer.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3558,11 +3558,10 @@ static int error_failed_squash(struct repository *r,
35583558

35593559
static int do_exec(struct repository *r, const char *command_line)
35603560
{
3561-
const char *child_argv[] = { NULL, NULL };
3561+
const char *child_argv[] = { command_line, NULL };
35623562
int dirty, status;
35633563

35643564
fprintf(stderr, _("Executing: %s\n"), command_line);
3565-
child_argv[0] = command_line;
35663565
status = run_command_v_opt(child_argv, RUN_USING_SHELL);
35673566

35683567
/* force re-reading of the cache */

0 commit comments

Comments
 (0)