[refs #579] change 'base' & 'head' -> 'to' & 'from'

This commit is contained in:
Alexander Machehin 2012-10-08 21:36:23 +06:00
parent 70e8a1fe0d
commit fcfdf1b26b
1 changed files with 3 additions and 3 deletions

View File

@ -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