summaryrefslogtreecommitdiff
path: root/run-command.h
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-10-19 11:13:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-10-19 22:26:31 (GMT)
commit19a583dc39e3e1110f746e837c5ce1953d6ebfa1 (patch)
tree6e16bc5612a97be1602c703a622dba52b55b3b56 /run-command.h
parent98349e5364da6164add4ede3e63ceba2cc39159b (diff)
downloadgit-19a583dc39e3e1110f746e837c5ce1953d6ebfa1.zip
git-19a583dc39e3e1110f746e837c5ce1953d6ebfa1.tar.gz
git-19a583dc39e3e1110f746e837c5ce1953d6ebfa1.tar.bz2
run-command: add env_array, an optional argv_array for env
Similar to args, add a struct argv_array member to struct child_process that simplifies specifying the environment for children. It is freed automatically by finish_command() or if start_command() encounters an error. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.h')
-rw-r--r--run-command.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/run-command.h b/run-command.h
index 1b135d1..2137315 100644
--- a/run-command.h
+++ b/run-command.h
@@ -10,6 +10,7 @@
struct child_process {
const char **argv;
struct argv_array args;
+ struct argv_array env_array;
pid_t pid;
/*
* Using .in, .out, .err:
@@ -44,7 +45,7 @@ struct child_process {
unsigned clean_on_exit:1;
};
-#define CHILD_PROCESS_INIT { NULL, ARGV_ARRAY_INIT }
+#define CHILD_PROCESS_INIT { NULL, ARGV_ARRAY_INIT, ARGV_ARRAY_INIT }
void child_process_init(struct child_process *);
int start_command(struct child_process *);