/** * Returns the current revision * * @return GitPHP_Commit */ function current() { if (!$this->dataLoaded) { $this->LoadData(); } return $this->project->GetCommit(current($this->hashList)); }
/** * Gets the blame * * @return array blame data */ public function GetBlame() { if (!$this->dataLoaded) { $this->LoadData(); } $blame = $this->blame; foreach ($blame as $line => $hash) { $blame[$line] = $this->project->GetCommit($hash); } return $blame; }
/** * Constructor * * @param GitPHP_Project $project project * @param GitPHP_GitExe $exe executable * @param string $toHash to commit hash * @param string $fromHash from commit hash * @param boolean $renames whether to detect file renames */ public function __construct($project, $exe, $toHash, $fromHash = '', $renames = false) { if (!$project) { throw new Exception('Project is required'); } $this->project = $project; if (!$exe) { throw new Exception('Git executable is required'); } $this->exe = $exe; $toCommit = $project->GetCommit($toHash); $this->toHash = $toHash; if (empty($fromHash)) { $parent = $toCommit->GetParent(); if ($parent) { $this->fromHash = $parent->GetHash(); } } else { $this->fromHash = $fromHash; } $this->renames = $renames; }
/** * Gets the head this log will walk from * * @return GitPHP_Commit head commit */ public function GetHead() { return $this->project->GetCommit($this->hash); }