Fix crashes in tag commit load
Fix crashes in tag commit load

--- a/include/git/Tag.class.php
+++ b/include/git/Tag.class.php
@@ -161,14 +161,14 @@
 		if ($this->commitReferenced)
 			$this->DereferenceCommit();
 
-		if (!$this->commit)
-			$this->ReadCommit();
-
 		if ($this->commit)
 			return $this->commit;
 
-		if (!$this->dataRead)
-			$this->ReadData();
+		if (!$this->dataRead) {
+			$this->ReadData();
+			if ($this->commitReferenced)
+				$this->DereferenceCommit();
+		}
 
 		return $this->commit;
 	}
@@ -419,7 +419,7 @@
 	 */
 	private function ReadCommit()
 	{
-		$exe = new GitPHP_GitExe($this);
+		$exe = new GitPHP_GitExe($this->GetProject());
 		$args = array();
 		$args[] = '--tags';
 		$args[] = '--dereference';

comments