diff options
Diffstat (limited to 'app/controllers/projects/compare_controller.rb')
-rw-r--r-- | app/controllers/projects/compare_controller.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb new file mode 100644 index 00000000000..126a2ea50c9 --- /dev/null +++ b/app/controllers/projects/compare_controller.rb @@ -0,0 +1,23 @@ +class Projects::CompareController < Projects::ApplicationController + # Authorize + before_filter :authorize_read_project! + before_filter :authorize_code_access! + before_filter :require_non_empty_project + + def index + end + + def show + compare = Gitlab::Git::Compare.new(project.repository, params[:from], params[:to]) + + @commits = compare.commits + @commit = compare.commit + @diffs = compare.diffs + @refs_are_same = compare.same + @line_notes = [] + end + + def create + redirect_to project_compare_path(@project, params[:from], params[:to]) + end +end |