X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=run-command.c;h=7e779d33ee9ea5f7d2e6aedc8c3a0a0476e87135;hb=154c7d0759b6885034bffa7a34d464d703fc8bb3;hp=4ee4bdf16c1c5288d63ed0ba9a4503d04377c19e;hpb=ee4931486b752b0a3ee04be31f25aed13913cb31;p=git.git 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);