Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2022-10-30 14:49:37 +0300
committerTaylor Blau <me@ttaylorr.com>2022-10-30 21:04:37 +0300
commit242aa33de0f18bf09dd147401af9b44cf961d532 (patch)
tree93f6ccc076f4b9d0da4618259e29b0e111841eba
parenteede29aa359a3049d1d1aea38a2cfc3eb547a23c (diff)
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>
-rw-r--r--sequencer.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sequencer.c b/sequencer.c
index debb2ecbafe..66eedd2c764 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3558,11 +3558,10 @@ static int error_failed_squash(struct repository *r,
static int do_exec(struct repository *r, const char *command_line)
{
- const char *child_argv[] = { NULL, NULL };
+ const char *child_argv[] = { command_line, NULL };
int dirty, status;
fprintf(stderr, _("Executing: %s\n"), command_line);
- child_argv[0] = command_line;
status = run_command_v_opt(child_argv, RUN_USING_SHELL);
/* force re-reading of the cache */