run-command: prepare child environment before forking
commitae25394b4c21f072f176ccbaf7047abe7fa5f04d
authorBrandon Williams <bmwill@google.com>
Wed, 19 Apr 2017 23:13:22 +0000 (19 16:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Apr 2017 00:55:32 +0000 (20 17:55 -0700)
treec04504f47cb2a5e3657e4e4d9aaeb4f240c5300c
parent3a30033327337323e91dcbcb87396d3245260585
run-command: prepare child environment before forking

In order to avoid allocation between 'fork()' and 'exec()' prepare the
environment to be used in the child process prior to forking.

Switch to using 'execve()' so that the construct child environment can
used in the exec'd process.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c