diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-29 12:33:51 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-29 12:33:51 +0300 |
commit | 378a3f5ca1286f4458632461067516e5c0a8f561 (patch) | |
tree | 1325dd44a95b99d35a94618e52e6e97663898e39 | |
parent | 098ee55e3c153b558c466c90bde9a18062bd33ef (diff) | |
download | gitlab-ce-378a3f5ca1286f4458632461067516e5c0a8f561.tar.gz |
Use CompareService for compare page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | app/controllers/projects/compare_controller.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb index eae96396574..5066754fd0d 100644 --- a/app/controllers/projects/compare_controller.rb +++ b/app/controllers/projects/compare_controller.rb @@ -8,14 +8,21 @@ class Projects::CompareController < Projects::ApplicationController end def show - compare = Gitlab::Git::Compare.new(@repository.raw_repository, params[:from], params[:to], MergeRequestDiff::COMMITS_SAFE_SIZE) + base_ref = params[:from] + head_ref = params[:to] - @commits = compare.commits - @commit = compare.commit - @diffs = compare.diffs - @refs_are_same = compare.same - @line_notes = [] - @diff_timeout = compare.timeout + compare_result = CompareService.new.execute( + current_user, + @project, + base_ref, + @project, + head_ref + ) + + @commits = compare_result.commits + @diffs = compare_result.diffs + @commit = @commits.last + @line_notes = [] end def create |