diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-09-03 12:37:03 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-03 12:37:04 -0700 |
commit | 3f02c0ad360d96e8dbba92f97b42ebbaa4319db1 (patch) | |
tree | 8bf47ece00982d35cc9f4e5399dbb363f767e95f /submodule.c | |
parent | 18aff08e04502c565e9a0538df12d04f2ca8765c (diff) | |
parent | afbdba391eaf3c473eff8f12437ff510935b520f (diff) | |
download | git-3f02c0ad360d96e8dbba92f97b42ebbaa4319db1.tar.gz |
Merge branch 'jc/run-command-use-embedded-args'
Various callers of run_command API has been modernized.
* jc/run-command-use-embedded-args:
run_command: teach API users to use embedded 'args' more
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 d0b70ca536..3cbcf40dfc 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; |