Commit 6a46926f authored by Sean McGivern's avatar Sean McGivern

Remove unused argument to CompareService#execute

parent 4add7f65
......@@ -14,7 +14,7 @@ class Projects::CompareController < Projects::ApplicationController
def show
compare = CompareService.new.
execute(@project, @head_ref, @project, @start_ref, diff_options)
execute(@project, @head_ref, @project, @start_ref)
if compare
@commits = Commit.decorate(compare.commits, @project)
......@@ -37,18 +37,24 @@ class Projects::CompareController < Projects::ApplicationController
def diff_for_path
compare = CompareService.new.
execute(@project, @head_ref, @project, @base_ref, diff_options)
execute(@project, @head_ref, @project, @start_ref)
return render_404 unless compare
@start_commit = @project.commit(@start_ref)
@commit = @project.commit(@head_ref)
@base_commit = @project.merge_base_commit(@base_ref, @head_ref)
@base_commit = @project.merge_base_commit(@start_ref, @head_ref)
diffs = compare.diffs(diff_options.merge(paths: [params[:path]]))
diff_refs = Gitlab::Diff::DiffRefs.new(
base_sha: @base_commit.try(:sha),
start_sha: @start_commit.try(:sha),
head_sha: @commit.try(:sha)
)
@diff_notes_disabled = true
@grouped_diff_notes = {}
render_diff_for_path(diffs, [@base_commit, @commit], @project)
render_diff_for_path(diffs, diff_refs, @project)
end
def create
......
......@@ -3,7 +3,7 @@ require 'securerandom'
# Compare 2 branches for one repo or between repositories
# and return Gitlab::Git::Compare object that responds to commits and diffs
class CompareService
def execute(source_project, source_branch, target_project, target_branch, diff_options = {})
def execute(source_project, source_branch, target_project, target_branch)
source_commit = source_project.commit(source_branch)
return unless source_commit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment