Esempio n. 1
0
 /**
  * Return the hash of the commit, used to name this commit.
  * @return string
  */
 public function Name()
 {
     if ($this->name == null) {
         $this->name = $this->commit->getFixedShortHash(8);
     }
     return $this->name;
 }
Esempio n. 2
0
 /**
  * @param string $sha
  * @return array
  */
 protected function getCommitData($sha)
 {
     try {
         $repo = $this->Project()->getRepository();
         if ($repo !== false) {
             $commit = new \Gitonomy\Git\Commit($repo, $sha);
             return ['AuthorName' => (string) Convert::raw2xml($commit->getAuthorName()), 'AuthorEmail' => (string) Convert::raw2xml($commit->getAuthorEmail()), 'Message' => (string) Convert::raw2xml($commit->getMessage()), 'ShortHash' => Convert::raw2xml($commit->getFixedShortHash(8)), 'Hash' => Convert::raw2xml($commit->getHash())];
         }
     } catch (\Gitonomy\Git\Exception\ReferenceNotFoundException $exc) {
         SS_Log::log($exc, SS_Log::WARN);
     }
     return array('AuthorName' => '(unknown)', 'AuthorEmail' => '(unknown)', 'Message' => '(unknown)', 'ShortHash' => $sha, 'Hash' => '(unknown)');
 }