[refs #579] fix checking path

This commit is contained in:
Alexander Machehin 2012-10-08 21:36:46 +06:00
parent fcfdf1b26b
commit a5477926bc
1 changed files with 2 additions and 1 deletions

View File

@ -68,7 +68,8 @@ class Projects::CommentsController < Projects::BaseController
@comment.data[:to_commit], @comment.data[:from_commit] = to_commit, from_commit
diff = pull.diff repo, to_commit, from_commit
return false unless diff_path = diff.select {|d| d.a_path == params[:path]}
diff_path = diff.select {|d| d.a_path == params[:path]}
return false if diff_path.blank?
comment_line = params[:line].to_i
return false if comment_line == 0 # NB! also dont want create comment to the diff header