diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-10-24 14:57:53 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-10-24 14:57:54 -0700 |
commit | 217610d7d61864f24efc0ea837dc911be44fd9c6 (patch) | |
tree | ebcbe1cde6d22498c7007a0b3e117e93168378f8 /wt-status.c | |
parent | f35a02b15d22521c4902d8b3434c7c55eeab4a1d (diff) | |
parent | a915459097b72da9cc058172a54029352b684b0f (diff) | |
download | git-217610d7d61864f24efc0ea837dc911be44fd9c6.tar.gz |
Merge branch 'rs/run-command-env-array'
Add managed "env" array to child_process to clarify the lifetime
rules.
* rs/run-command-env-array:
use env_array member of struct child_process
run-command: add env_array, an optional argv_array for env
Diffstat (limited to 'wt-status.c')
-rw-r--r-- | wt-status.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/wt-status.c b/wt-status.c index f367066f92..cdbc8d798a 100644 --- a/wt-status.c +++ b/wt-status.c @@ -726,14 +726,14 @@ static void wt_status_print_changed(struct wt_status *s) static void wt_status_print_submodule_summary(struct wt_status *s, int uncommitted) { struct child_process sm_summary = CHILD_PROCESS_INIT; - struct argv_array env = ARGV_ARRAY_INIT; struct argv_array argv = ARGV_ARRAY_INIT; struct strbuf cmd_stdout = STRBUF_INIT; struct strbuf summary = STRBUF_INIT; char *summary_content; size_t len; - argv_array_pushf(&env, "GIT_INDEX_FILE=%s", s->index_file); + argv_array_pushf(&sm_summary.env_array, "GIT_INDEX_FILE=%s", + s->index_file); argv_array_push(&argv, "submodule"); argv_array_push(&argv, "summary"); @@ -745,14 +745,12 @@ static void wt_status_print_submodule_summary(struct wt_status *s, int uncommitt argv_array_push(&argv, s->amend ? "HEAD^" : "HEAD"); sm_summary.argv = argv.argv; - sm_summary.env = env.argv; sm_summary.git_cmd = 1; sm_summary.no_stdin = 1; fflush(s->fp); sm_summary.out = -1; run_command(&sm_summary); - argv_array_clear(&env); argv_array_clear(&argv); len = strbuf_read(&cmd_stdout, sm_summary.out, 1024); |