diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/repositories_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/wikis_controller.rb | 6 | ||||
-rw-r--r-- | app/models/gollum_wiki.rb | 6 | ||||
-rw-r--r-- | app/models/network/graph.rb | 23 |
4 files changed, 14 insertions, 23 deletions
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 229cb36949b..6fba2518306 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -17,7 +17,7 @@ class RepositoriesController < ProjectResourceController end def stats - @stats = Gitlab::GitStats.new(@repository.raw, @repository.root_ref) + @stats = Gitlab::Git::Stats.new(@repository.raw, @repository.root_ref) @graph = @stats.graph end diff --git a/app/controllers/wikis_controller.rb b/app/controllers/wikis_controller.rb index 940b1e97340..be9ae4f37a4 100644 --- a/app/controllers/wikis_controller.rb +++ b/app/controllers/wikis_controller.rb @@ -49,9 +49,9 @@ class WikisController < ProjectResourceController end def history - unless @wiki = @gollum_wiki.find_page(params[:id]) - redirect_to project_wiki_path(@project, :home), notice: "Page not found" - end + @wiki = @gollum_wiki.find_page(params[:id]) + + redirect_to(project_wiki_path(@project, :home), notice: "Page not found") unless @wiki end def destroy diff --git a/app/models/gollum_wiki.rb b/app/models/gollum_wiki.rb index 16e801c1fdb..8168347926b 100644 --- a/app/models/gollum_wiki.rb +++ b/app/models/gollum_wiki.rb @@ -47,12 +47,6 @@ class GollumWiki wiki.pages.map { |page| WikiPage.new(self, page, true) } end - # Returns the last 30 Commit objects across the entire - # repository. - def recent_history - Gitlab::Git::Commit.fresh_commits(wiki.repo, 30) - end - # Finds a page within the repository based on a tile # or slug. # diff --git a/app/models/network/graph.rb b/app/models/network/graph.rb index 2957adbfc19..2419b719d20 100644 --- a/app/models/network/graph.rb +++ b/app/models/network/graph.rb @@ -25,10 +25,9 @@ module Network def collect_commits refs_cache = build_refs_cache - find_commits(count_to_display_commit_in_center) - .map do |commit| - # Decorate with app/model/network/commit.rb - Network::Commit.new(commit, refs_cache[commit.id]) + find_commits(count_to_display_commit_in_center).map do |commit| + # Decorate with app/model/network/commit.rb + Network::Commit.new(commit, refs_cache[commit.id]) end end @@ -93,15 +92,13 @@ module Network end def find_commits(skip = 0) - Grit::Commit.find_all( - @repo, - nil, - { - date_order: true, - max_count: self.class.max_count, - skip: skip - } - ) + opts = { + date_order: true, + max_count: self.class.max_count, + skip: skip + } + + Grit::Commit.find_all(@repo, opts, nil) end def commits_sort_by_ref |