diff --git a/app/controllers/projects/comments_controller.rb b/app/controllers/projects/comments_controller.rb index f9197aacf..832e8f7f0 100644 --- a/app/controllers/projects/comments_controller.rb +++ b/app/controllers/projects/comments_controller.rb @@ -64,10 +64,10 @@ class Projects::CommentsController < Projects::BaseController @comment.data = {:path => params[:path], :line => params[:line]} if @commentable.class == Issue && pull = @commentable.pull_request repo = Grit::Repo.new(pull.path) - base_commit, head_commit = pull.common_ancestor, repo.commits(pull.head_branch).first - @comment.data[:base_commit], @comment.data[:head_commit] = base_commit, head_commit + to_commit, from_commit = pull.common_ancestor, repo.commits(pull.head_branch).first + @comment.data[:to_commit], @comment.data[:from_commit] = to_commit, from_commit - diff = pull.diff repo, base_commit, head_commit + diff = pull.diff repo, to_commit, from_commit return false unless diff_path = diff.select {|d| d.a_path == params[:path]} comment_line = params[:line].to_i return false if comment_line == 0 # NB! also dont want create comment to the diff header