Fix merge commit logic
Fix merge commit logic

A commit is a merge commit if it has multiple parents. The tip commit
of each head being merged become the parents of the merge commit.

--- a/include/git/Commit.class.php
+++ b/include/git/Commit.class.php
@@ -195,17 +195,6 @@
 	 */
 	private $treeReferenced = false;
 
-
-	/**
-	 * mergeCommit *tpr*
-	 *
-	 * Stores whether the commit is a Merge
-	 *
-	 * @access private
-	 */
-	private $mergeCommit = false;
-
-
 	/**
 	 * __construct
 	 *
@@ -536,7 +525,7 @@
 		if (!$this->dataRead)
 			$this->ReadData();
 
-		return $this->mergeCommit;
+		return count($this->parents) > 1;
 	}
 
 	/**
@@ -608,9 +597,6 @@
 					if (empty($this->title) && (strlen($trimmed) > 0))
 						$this->title = $trimmed;
 					if (!empty($this->title)) {
-						if (substr($this->title,0,6) == "Merge ")
-							$this->mergeCommit = true;
-
 						if ((strlen($trimmed) > 0) || ($i < (count($lines)-1)))
 							$this->comment[] = $trimmed;
 					}
@@ -1011,7 +997,7 @@
 		if (!$this->treeReferenced)
 			$this->ReferenceTree();
 
-		$properties = array('dataRead', 'parents', 'tree', 'author', 'authorEpoch', 'authorTimezone', 'committer', 'committerEpoch', 'committerTimezone', 'title', 'comment', 'readTree', 'blobPaths', 'treePaths', 'hashPathsRead', 'parentsReferenced', 'treeReferenced', 'mergeCommit');
+		$properties = array('dataRead', 'parents', 'tree', 'author', 'authorEpoch', 'authorTimezone', 'committer', 'committerEpoch', 'committerTimezone', 'title', 'comment', 'readTree', 'blobPaths', 'treePaths', 'hashPathsRead', 'parentsReferenced', 'treeReferenced');
 		return array_merge($properties, parent::__sleep());
 	}
 

comments