diff options
author | Daniel Gerhardt <code@dgerhardt.net> | 2015-07-02 20:12:24 +0200 |
---|---|---|
committer | Daniel Gerhardt <code@dgerhardt.net> | 2015-07-06 16:44:30 +0200 |
commit | 2963e7fd1c64af8482eaa82579ccdef5af1ef55a (patch) | |
tree | 1740104359c002c38526bd4bf4702073ea02cec8 /app/controllers/projects/graphs_controller.rb | |
parent | 570fd9f590e06c378de82897fce31e1dbc020c0d (diff) | |
download | gitlab-ce-2963e7fd1c64af8482eaa82579ccdef5af1ef55a.tar.gz |
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.rb | 7 |
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| |