There's no need to keep passing gitbin in
There's no need to keep passing gitbin in

--- a/include/git/Commit.class.php
+++ b/include/git/Commit.class.php
@@ -384,7 +384,7 @@
 		$this->dataRead = true;
 
 		/* get data from git_rev_list */
-		$exe = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'), $this->project);
+		$exe = new GitPHP_GitExe($this->project);
 		$args = array();
 		$args[] = '--header';
 		$args[] = '--parents';

--- a/include/git/GitExe.class.php
+++ b/include/git/GitExe.class.php
@@ -45,8 +45,9 @@
 	 * @param mixed $project project to operate on
 	 * @return mixed git executable class
 	 */
-	public function __construct($binary, $project = null)
+	public function __construct($project = null)
 	{
+		$this->binary = GitPHP_Config::GetInstance()->GetValue('gitbin');
 		if (empty($binary)) {
 			// try to pick a reasonable default
 			if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {

--- a/include/git/Project.class.php
+++ b/include/git/Project.class.php
@@ -292,7 +292,7 @@
 	{
 		$this->readHead = true;
 
-		$exe = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'), $this);
+		$exe = new GitPHP_GitExe($this);
 		$args = array();
 		$args[] = '--verify';
 		$args[] = 'HEAD';

--- a/include/gitutil.git_archive.php
+++ b/include/gitutil.git_archive.php
@@ -17,7 +17,7 @@
 	if (!$gitphp_current_project)
 		return '';
 
-	$exe = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'), $gitphp_current_project);
+	$exe = new GitPHP_GitExe($gitphp_current_project);
 
 	$args = array();
 	$args[] = '--format=' . $fmt;

--- a/include/gitutil.git_cat_file.php
+++ b/include/gitutil.git_cat_file.php
@@ -17,7 +17,7 @@
 	if (!$gitphp_current_project)
 		return '';
 
-	$exe = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'), $gitphp_current_project);
+	$exe = new GitPHP_GitExe($gitphp_current_project);
 
 	$args = array();
 	$args[] = $type;

--- a/include/gitutil.git_diff_tree.php
+++ b/include/gitutil.git_diff_tree.php
@@ -17,7 +17,7 @@
 	if (!$gitphp_current_project)
 		return '';
 
-	$exe = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'), $gitphp_current_project);
+	$exe = new GitPHP_GitExe($gitphp_current_project);
 
 	$args = array();
 	$args[] = '-r';

--- a/include/gitutil.git_grep.php
+++ b/include/gitutil.git_grep.php
@@ -17,7 +17,7 @@
 	if (!$gitphp_current_project)
 		return '';
 
-	$exe = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'), $gitphp_current_project);
+	$exe = new GitPHP_GitExe($gitphp_current_project);
 
 	$args = array();
 	if (!$binary)

--- a/include/gitutil.git_history_list.php
+++ b/include/gitutil.git_history_list.php
@@ -17,7 +17,7 @@
 	if (!$gitphp_current_project)
 		return '';
 
-	$exe = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'), $gitphp_current_project);
+	$exe = new GitPHP_GitExe($gitphp_current_project);
 
 	$args = array();
 	$args[] = $hash;

--- a/include/gitutil.git_ls_tree.php
+++ b/include/gitutil.git_ls_tree.php
@@ -17,7 +17,7 @@
 	if (!$gitphp_current_project)
 		return '';
 
-	$exe = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'), $gitphp_current_project);
+	$exe = new GitPHP_GitExe($gitphp_current_project);
 
 	$args = array();
 	if ($nullterm)

--- a/include/gitutil.git_read_blame.php
+++ b/include/gitutil.git_read_blame.php
@@ -17,7 +17,7 @@
 	if (!$gitphp_current_project)
 		return '';
 
-	$exe = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'), $gitphp_current_project);
+	$exe = new GitPHP_GitExe($gitphp_current_project);
 
 	$args = array();
 

--- a/include/gitutil.git_rev_list.php
+++ b/include/gitutil.git_rev_list.php
@@ -17,7 +17,7 @@
 	if (!$gitphp_current_project)
 		return '';
 
-	$exe = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'), $gitphp_current_project);
+	$exe = new GitPHP_GitExe($gitphp_current_project);
 
 	$args = array();
 

--- a/include/gitutil.git_version.php
+++ b/include/gitutil.git_version.php
@@ -11,7 +11,7 @@
 
  function git_version()
  {
- 	$exe = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'));
+ 	$exe = new GitPHP_GitExe();
 	$out = $exe->Execute('', array('--version'));
 
  	$verstr = explode(" ", $out);

--- a/include/gitutil.read_info_ref.php
+++ b/include/gitutil.read_info_ref.php
@@ -17,7 +17,7 @@
 	if (!$gitphp_current_project)
 		return;
 
-	$exe = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'), $gitphp_current_project);
+	$exe = new GitPHP_GitExe($gitphp_current_project);
 	
 	$showrefs = $exe->Execute(GIT_SHOW_REF, array('--dereference'));
 

comments