aboutsummaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/run-command.c b/run-command.c
index 4ee4bdf16..7e779d33e 100644
--- a/run-command.c
+++ b/run-command.c
@@ -77,8 +77,12 @@ int start_command(struct child_process *cmd)
die("exec %s: cd to %s failed (%s)", cmd->argv[0],
cmd->dir, strerror(errno));
if (cmd->env) {
- for (; *cmd->env; cmd->env++)
- putenv((char*)*cmd->env);
+ for (; *cmd->env; cmd->env++) {
+ if (strchr(*cmd->env, '='))
+ putenv((char*)*cmd->env);
+ else
+ unsetenv(*cmd->env);
+ }
}
if (cmd->git_cmd) {
execv_git_cmd(cmd->argv);