diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-08-27 01:25:03 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-08-27 01:32:37 +0300 |
commit | afbdba391eaf3c473eff8f12437ff510935b520f (patch) | |
tree | 06acc6a781e2c598873943ee407513a60ef7a3db /submodule.c | |
parent | 47ae905ffb98cc4d4fd90083da6bc8dab55d9ecc (diff) |
run_command: teach API users to use embedded 'args' more
The child_process structure has an embedded strvec for formulating
the command line argument list these days, but code that predates
the wide use of it prepared a separate char *argv[] array and
manually set the child_process.argv pointer point at it.
Teach these old-style code to lose the separate argv[] array.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/submodule.c b/submodule.c index e2ef5698c8..0e3bf5bbfe 100644 --- a/submodule.c +++ b/submodule.c @@ -1726,14 +1726,6 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked) int submodule_uses_gitfile(const char *path) { struct child_process cp = CHILD_PROCESS_INIT; - const char *argv[] = { - "submodule", - "foreach", - "--quiet", - "--recursive", - "test -f .git", - NULL, - }; struct strbuf buf = STRBUF_INIT; const char *git_dir; @@ -1746,7 +1738,10 @@ int submodule_uses_gitfile(const char *path) strbuf_release(&buf); /* Now test that all nested submodules use a gitfile too */ - cp.argv = argv; + strvec_pushl(&cp.args, + "submodule", "foreach", "--quiet", "--recursive", + "test -f .git", NULL); + prepare_submodule_repo_env(&cp.env_array); cp.git_cmd = 1; cp.no_stdin = 1; |