Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gerhardt <code@dgerhardt.net>2015-07-02 21:12:24 +0300
committerDaniel Gerhardt <code@dgerhardt.net>2015-07-06 17:44:30 +0300
commit2963e7fd1c64af8482eaa82579ccdef5af1ef55a (patch)
tree1740104359c002c38526bd4bf4702073ea02cec8 /app/controllers/projects/graphs_controller.rb
parent570fd9f590e06c378de82897fce31e1dbc020c0d (diff)
Add ref switching support for graphs
It is now possible to view contributor and commit statistics for refs beyond the default branch. Additionally, conditions in RefsController#switch have been refactored in order that a `case` block is used now.
Diffstat (limited to 'app/controllers/projects/graphs_controller.rb')
-rw-r--r--app/controllers/projects/graphs_controller.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/projects/graphs_controller.rb b/app/controllers/projects/graphs_controller.rb
index a060ea6f998..0b6f7f5c91e 100644
--- a/app/controllers/projects/graphs_controller.rb
+++ b/app/controllers/projects/graphs_controller.rb
@@ -1,6 +1,9 @@
class Projects::GraphsController < Projects::ApplicationController
+ include ExtractsPath
+
# Authorize
before_action :require_non_empty_project
+ before_action :assign_ref_vars
before_action :authorize_download_code!
def show
@@ -13,7 +16,7 @@ class Projects::GraphsController < Projects::ApplicationController
end
def commits
- @commits = @project.repository.commits(nil, nil, 2000, 0, true)
+ @commits = @project.repository.commits(@ref, nil, 2000, 0, true)
@commits_graph = Gitlab::Graphs::Commits.new(@commits)
@commits_per_week_days = @commits_graph.commits_per_week_days
@commits_per_time = @commits_graph.commits_per_time
@@ -23,7 +26,7 @@ class Projects::GraphsController < Projects::ApplicationController
private
def fetch_graph
- @commits = @project.repository.commits(nil, nil, 6000, 0, true)
+ @commits = @project.repository.commits(@ref, nil, 6000, 0, true)
@log = []
@commits.each do |commit|