Move most project references to be fetched off of project list
[gitphp.git] / include / git / GitExe.class.php
blob:a/include/git/GitExe.class.php -> blob:b/include/git/GitExe.class.php
--- a/include/git/GitExe.class.php
+++ b/include/git/GitExe.class.php
@@ -74,6 +74,19 @@
 	}
 
 	/**
+	 * GetProject
+	 *
+	 * Gets the project
+	 *
+	 * @access public
+	 * @return mixed project
+	 */
+	public function GetProject()
+	{
+		return GitPHP_ProjectList::GetInstance()->GetProject($this->project);
+	}
+
+	/**
 	 * SetProject
 	 *
 	 * Sets the project for this executable
@@ -82,7 +95,10 @@
 	 */
 	public function SetProject($project = null)
 	{
-		$this->project = $project;
+		if ($project)
+			$this->project = $project->GetProject();
+		else
+			$this->project = null;
 	}
 
 	/**
@@ -139,7 +155,7 @@
 	{
 		$gitDir = '';
 		if ($this->project) {
-			$gitDir = '--git-dir=' . $this->project->GetPath();
+			$gitDir = '--git-dir=' . $this->GetProject()->GetPath();
 		}
 		
 		return $this->binary . ' ' . $gitDir . ' ' . $command . ' ' . implode(' ', $args);

comments