summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-02-21 02:06:39 +0000
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-02-21 02:06:39 +0000
commita224a655d812d60fa8be45e36922049b313ecb2f (patch)
tree62ce86cdaca646f9d51b715da6dd4fb429d8e672 /lib
parent5484acd99878a70e95bd5e1f22900b2fd6c612c1 (diff)
parent0632e85c82eeb76c9b61e497655c9cf2ef5dc262 (diff)
downloadgitlab-ce-a224a655d812d60fa8be45e36922049b313ecb2f.tar.gz
Merge branch 'mr-commit-comment-diff-lines' into 'master'
Fix commit comments on first line of diff not rendering in Merge Request Discussion view. Example can be seen near the bottom on this MR: !1533. Before: ![Screen Shot 2015-02-20 at 10.24.34](https://dev.gitlab.org/uploads/gitlab/gitlabhq/35600b98b5/Screen_Shot_2015-02-20_at_10.24.34.png) After: the [note](https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/1533/diffs#note_36449) is actually rendered. See merge request !1552
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/diff/parser.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/diff/parser.rb b/lib/gitlab/diff/parser.rb
index 887ed76b36c..c1d9520ddf1 100644
--- a/lib/gitlab/diff/parser.rb
+++ b/lib/gitlab/diff/parser.rb
@@ -27,7 +27,7 @@ module Gitlab
line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0
line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0
- next if line_old == 1 && line_new == 1 #top of file
+ next if line_old <= 1 && line_new <= 1 #top of file
lines_obj << Gitlab::Diff::Line.new(full_line, type, line_obj_index, line_old, line_new)
line_obj_index += 1
next