Inject exe into object manager
Inject exe into object manager

--- a/include/git/GitObjectManager.class.php
+++ b/include/git/GitObjectManager.class.php
@@ -38,6 +38,13 @@
 	protected $compat = false;
 
 	/**
+	 * Executable
+	 *
+	 * @var GitPHP_GitExe
+	 */
+	protected $exe;
+
+	/**
 	 * Constructor
 	 *
 	 * @param GitPHP_Project $project project
@@ -51,6 +58,16 @@
 	}
 
 	/**
+	 * Set executable
+	 *
+	 * @param GitPHP_GitExe $exe executable
+	 */
+	public function SetExe($exe)
+	{
+		$this->exe = $exe;
+	}
+
+	/**
 	 * Get project
 	 *
 	 * @return GitPHP_Project
@@ -146,9 +163,9 @@
 
 			$strategy = null;
 			if ($this->compat) {
-				$strategy = new GitPHP_CommitLoad_Git(GitPHP_GitExe::GetInstance());
-			} else {
-				$strategy = new GitPHP_CommitLoad_Raw($this->project->GetObjectLoader(), GitPHP_GitExe::GetInstance());
+				$strategy = new GitPHP_CommitLoad_Git($this->exe);
+			} else {
+				$strategy = new GitPHP_CommitLoad_Raw($this->project->GetObjectLoader(), $this->exe);
 			}
 
 			if ($commit) {
@@ -194,7 +211,7 @@
 
 			$strategy = null;
 			if ($this->compat) {
-				$strategy = new GitPHP_TagLoad_Git(GitPHP_GitExe::GetInstance());
+				$strategy = new GitPHP_TagLoad_Git($this->exe);
 			} else {
 				$strategy = new GitPHP_TagLoad_Raw($this->project->GetObjectLoader());
 			}
@@ -268,7 +285,7 @@
 
 			$strategy = null;
 			if ($this->compat) {
-				$strategy = new GitPHP_BlobLoad_Git(GitPHP_GitExe::GetInstance());
+				$strategy = new GitPHP_BlobLoad_Git($this->exe);
 			} else {
 				$strategy = new GitPHP_BlobLoad_Raw($this->project->GetObjectLoader());
 			}
@@ -313,9 +330,9 @@
 
 			$strategy = null;
 			if ($this->compat) {
-				$strategy = new GitPHP_TreeLoad_Git(GitPHP_GitExe::GetInstance());
-			} else {
-				$strategy = new GitPHP_TreeLoad_Raw($this->project->GetObjectLoader(), GitPHP_GitExe::GetInstance());
+				$strategy = new GitPHP_TreeLoad_Git($this->exe);
+			} else {
+				$strategy = new GitPHP_TreeLoad_Raw($this->project->GetObjectLoader(), $this->exe);
 			}
 			if ($tree) {
 				$tree->SetProject($this->project);

--- a/include/git/projectlist/ProjectListBase.class.php
+++ b/include/git/projectlist/ProjectListBase.class.php
@@ -266,6 +266,7 @@
 
 		$manager = new GitPHP_GitObjectManager($project);
 		$manager->SetCompat($compat);
+		$manager->SetExe(GitPHP_GitExe::GetInstance());
 		if ($this->memoryCache) {
 			$manager->SetMemoryCache($this->memoryCache);
 		}

comments