Exemple #1
0
 /**
  * Returns the current revision
  *
  * @return GitPHP_Commit
  */
 function current()
 {
     if (!$this->dataLoaded) {
         $this->LoadData();
     }
     return $this->project->GetCommit(current($this->hashList));
 }
Exemple #2
0
 /**
  * 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;
 }
Exemple #3
0
 /**
  * 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);
 }