--- a/include/gitutil.git_exec_nix.php +++ b/include/gitutil.git_exec_nix.php @@ -10,7 +10,10 @@ function git_exec_nix($project, $command) { global $gitphp_conf; - $cmd = "env GIT_DIR=" . $project . " " . $gitphp_conf['gitbin'] . " " . $command; + $cmd = $gitphp_conf['gitbin']; + if (isset($project) && (strlen($project) > 0)) + $cmd .= " --git-dir=" . $project; + $cmd .= " " . $command; return shell_exec($cmd); }