コード例 #1
0
 /**
  * Loads the data for this search
  */
 protected function LoadData()
 {
     $this->dataLoaded = true;
     $args = array();
     if ($this->exe->CanIgnoreRegexpCase()) {
         $args[] = '--regexp-ignore-case';
     }
     switch ($this->type) {
         case GitPHP_CommitSearch::CommitType:
             $args[] = '--grep="' . addslashes($this->search) . '"';
             break;
         case GitPHP_CommitSearch::AuthorType:
             $args[] = '--author="' . addslashes($this->search) . '"';
             break;
         case GitPHP_CommitSearch::CommitterType:
             $args[] = '--committer="' . addslashes($this->search) . '"';
             break;
     }
     $this->hashList = $this->strategy->RevList($this->project, $this->hash, $this->limit, $this->skip, $args);
 }
コード例 #2
0
ファイル: Project.class.php プロジェクト: sandassha/gitstack
 /**
  * SearchCommitter
  *
  * Gets a list of commits with committers matching the given pattern
  *
  * @access public
  * @param string $pattern search pattern
  * @param string $hash hash to start searching from
  * @param integer $count number of results to get
  * @param integer $skip number of results to skip
  * @return array array of matching commits
  */
 public function SearchCommitter($pattern, $hash = 'HEAD', $count = 50, $skip = 0)
 {
     if (empty($pattern)) {
         return;
     }
     $args = array();
     $exe = new GitPHP_GitExe($this);
     if ($exe->CanIgnoreRegexpCase()) {
         $args[] = '--regexp-ignore-case';
     }
     unset($exe);
     $args[] = '--committer=\'' . $pattern . '\'';
     $ret = $this->RevList($hash, $count, $skip, $args);
     $len = count($ret);
     for ($i = 0; $i < $len; ++$i) {
         $ret[$i] = $this->GetCommit($ret[$i]);
     }
     return $ret;
 }