- $this->graph_data = new graph_data_generator();
- if($head == null) {
- //add all refs to the graph
- foreach($this->project['refs'] as $ref => $rhash) {
- if(preg_match('#^refs/heads/#i', $ref) && preg_match('/^[a-f0-9]*$/i', $rhash)) {
- $this->graph_data->add_branch($rhash, $ref);
+ if(GitConfig::GITGRAPH_ENABLE) {
+ if($max+$skip >= 2000) { //only load the last 2k commits
+ $real_skip = ($max+$skip) - 2000;
+ $skip -= $real_skip;
+ } else
+ $real_skip = 0;
+ } else {
+ $real_skip = $skip;
+ $skip = 0;
+ }
+
+ $commits = GitCommand::get_commits($project['path'], $head, $max+$skip+1, $real_skip, $file);
+
+ if(GitConfig::GITGRAPH_ENABLE) {
+ $this->graph_data = new graph_data_generator();
+ if($head == null) {
+ //add all refs to the graph
+ foreach($this->project['refs'] as $ref => $rhash) {
+ if(preg_match('#^refs/heads/#i', $ref) && preg_match('/^[a-f0-9]*$/i', $rhash)) {
+ $this->graph_data->add_branch($rhash, $ref);
+ }