Use --git-dir instead of env GIT_DIR
Use --git-dir instead of env GIT_DIR

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

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

comments