log() public method

Show commit logs.
public log ( ) : GitWorkingCopy
return GitWorkingCopy
Esempio n. 1
0
 /**
  * @param null $ref
  * @return int
  */
 public function getLog($ref = null)
 {
     $this->git->fetch();
     if (is_null($ref)) {
         $ref = $this->getCurrentBranchName();
     }
     $log = array_map(function ($entry) {
         $log = [];
         list($log['hash'], $log['message']) = explode(' ', $entry, 2);
         return $log;
     }, explode(PHP_EOL, trim($this->git->log($ref, ['oneline' => true])->getOutput())));
     return $log;
 }