http-backend: respect existing GIT_COMMITTER_* variables
commite32a4581bcbf1cf43cd5069a0d19df07542d612a
authorJeff King <peff@peff.net>
Fri, 30 Mar 2012 07:01:30 +0000 (30 03:01 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 30 Mar 2012 16:13:02 +0000 (30 09:13 -0700)
treebe814ca06dd1b2d522aa754621675f0870d537d7
parent8ced9c90a28f6abc80dc5ad4cf7921c2322c0bb0
http-backend: respect existing GIT_COMMITTER_* variables

The http-backend program sets default GIT_COMMITTER_NAME and
GIT_COMMITTER_EMAIL variables based on the REMOTE_USER and
REMOTE_ADDR variables provided by the webserver. However, it
unconditionally overwrites any existing GIT_COMMITTER
variables, which may have been customized by site-specific
code in the webserver (or in a script wrapping http-backend).

Let's leave those variables intact if they already exist,
assuming that any such configuration was intentional. There
is a slight chance of a regression if somebody has set
GIT_COMMITTER_* for the entire webserver, not intending it
to leak through http-backend. We could protect against this
by passing the information in alternate variables.  However,
it seems unlikely that anyone will care about that
regression, and there is value in the simplicity of using
the common variable names that are used elsewhere in git.

While we're tweaking the environment-handling in
http-backend, let's switch it to use argv_array to handle
the list of variables. That makes the memory management much
simpler.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-backend.c
t/lib-httpd/apache.conf
t/t5541-http-push.sh