/** * Gets a single head * * @param string $head head to find * @param string $hash hash of head, if known * @return GitPHP_Head head object */ public function GetHead($head, $hash = '') { if (empty($head)) { return null; } $key = GitPHP_Head::CacheKey($this->project->GetProject(), $head); $headObj = null; if ($this->memoryCache) { $headObj = $this->memoryCache->Get($key); } if (!$headObj) { $headObj = new GitPHP_Head($this->project, $head, $hash); if ($this->memoryCache) { $this->memoryCache->Set($key, $headObj); } } return $headObj; }