Remove now unused code in reflist
Remove now unused code in reflist

--- a/include/git/RefList.class.php
+++ b/include/git/RefList.class.php
@@ -15,13 +15,6 @@
 	 * @var GitPHP_Project
 	 */
 	protected $project;
-
-	/**
-	 * Whether this list is running in compatbility mode
-	 *
-	 * @var boolean
-	 */
-	protected $compat = false;
 
 	/**
 	 * The refs
@@ -61,144 +54,9 @@
 	}
 
 	/**
-	 * Gets whether this list is running in compatibility mode
-	 *
-	 * @return bool true if compatibilty mode
-	 */
-	public function GetCompat()
-	{
-		return $this->compat;
-	}
-
-	/**
-	 * Sets whether this list is running in compatibility mode
-	 *
-	 * @param bool $compat true if compatibility mode
-	 */
-	public function SetCompat($compat)
-	{
-		$this->compat = $compat;
-	}
-
-	/**
 	 * Loads data for this ref list
 	 */
 	protected abstract function LoadData();
-
-	/**
-	 * Reads the list of refs using the git executable
-	 *
-	 * @param string $type ref type
-	 * @return array array of refs
-	 */
-	protected function ReadRefListGit($type)
-	{
-		if (empty($type))
-			return;
-
-		$args = array();
-		$args[] = '--' . $type;
-		$ret = GitPHP_GitExe::GetInstance()->Execute($this->project->GetPath(), GIT_SHOW_REF, $args);
-
-		$lines = explode("\n", $ret);
-
-		$refs = array();
-
-		foreach ($lines as $line) {
-			if (preg_match('/^([0-9a-fA-F]{40}) refs\/' . $type . '\/([^^]+)(\^{})?$/', $line, $regs)) {
-				$refs[$regs[2]] = $regs[1];
-			}
-		}
-
-		return $refs;
-	}
-
-	/**
-	 * Reads the list of refs using the raw git files
-	 *
-	 * @param string $type ref type
-	 * @return array array of refs
-	 */
-	protected function ReadRefListRaw($type)
-	{
-		if (empty($type))
-			return;
-
-		$refs = array();
-
-		$prefix = 'refs/' . $type;
-		$fullPath = $this->project->GetPath() . '/' . $prefix;
-		$fullPathLen = strlen($fullPath) + 1;
-
-		/* loose files */
-		$refFiles = GitPHP_Util::ListDir($fullPath);
-		for ($i = 0; $i < count($refFiles); ++$i) {
-			$ref = substr($refFiles[$i], $fullPathLen);
-			
-			if (empty($ref) || isset($refs[$ref]))
-				continue;
-
-			$hash = trim(file_get_contents($refFiles[$i]));
-			if (preg_match('/^[0-9A-Fa-f]{40}$/', $hash)) {
-				$refs[$ref] = $hash;
-			}
-		}
-
-		/* packed refs */
-		if (file_exists($this->project->GetPath() . '/packed-refs')) {
-			$packedRefs = explode("\n", file_get_contents($this->project->GetPath() . '/packed-refs'));
-
-			foreach ($packedRefs as $ref) {
-
-				if (preg_match('/^([0-9A-Fa-f]{40}) refs\/' . $type . '\/(.+)$/', $ref, $regs)) {
-					if (!isset($refs[$regs[2]])) {
-						$refs[$regs[2]] = $regs[1];
-					}
-				}
-			}
-		}
-
-		return $refs;
-	}
-
-	/**
-	 * Get refs in a specific order using git executable
-	 *
-	 * @param string $type type of ref
-	 * @param string $order order to use
-	 * @param int $count limit the number of results
-	 * @return array array of refs
-	 */
-	protected function GetOrderedRefsGit($type, $order, $count = 0)
-	{
-		if (empty($type) || empty($order))
-			return null;
-
-		$args = array();
-		$args[] = '--sort=' . $order;
-		$args[] = '--format="%(refname)"';
-		if ($count > 0) {
-			$args[] = '--count=' . $count;
-		}
-		$args[] = '--';
-		$args[] = 'refs/' . $type;
-		$ret = GitPHP_GitExe::GetInstance()->Execute($this->project->GetPath(), GIT_FOR_EACH_REF, $args);
-
-		$lines = explode("\n", $ret);
-
-		$prefix = 'refs/' . $type . '/';
-		$prefixLen = strlen($prefix);
-
-		$refs = array();
-
-		foreach ($lines as $ref) {
-			$ref = substr($ref, $prefixLen);
-			if (!empty($ref))
-				$refs[] = $ref;
-		}
-
-		return $refs;
-	}
 
 	/**
 	 * Checks if a ref exists

--- a/include/git/projectlist/ProjectListBase.class.php
+++ b/include/git/projectlist/ProjectListBase.class.php
@@ -242,7 +242,6 @@
 			$headListStrategy = new GitPHP_HeadListLoad_Raw();
 		}
 		$headList = new GitPHP_HeadList($project, $headListStrategy);
-		$headList->SetCompat($compat);
 		$project->SetHeadList($headList);
 
 		$tagListStrategy = null;
@@ -252,7 +251,6 @@
 			$tagListStrategy = new GitPHP_TagListLoad_Raw();
 		}
 		$tagList = new GitPHP_TagList($project, $tagListStrategy);
-		$tagList->SetCompat($compat);
 		$project->SetTagList($tagList);
 
 		if (!$compat) {

comments