diff options
author | Rémy Coutable <remy@rymai.me> | 2016-06-01 08:42:36 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-06-01 08:42:36 +0000 |
commit | 46ac3107a4d0eaf12be8700bd33df90508e052c0 (patch) | |
tree | b2bffbc8561667474653dd96761f97247f54e026 /lib | |
parent | cb261abee199cef178a89146afb2a3d831a391a6 (diff) | |
parent | 56f3b243ce08d105758a9b6edf96792627fa423c (diff) | |
download | gitlab-ce-46ac3107a4d0eaf12be8700bd33df90508e052c0.tar.gz |
Merge branch 'issue_15557' into 'master'
Fix error 500 when sorting issues by milestone due date and filtering by labels
fixes #15557
See merge request !4327
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/diff/parser.rb | 14 | ||||
-rw-r--r-- | lib/gitlab/gitlab_import/importer.rb | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/gitlab/diff/parser.rb b/lib/gitlab/diff/parser.rb index 6fe7faa547a..522dd2b9428 100644 --- a/lib/gitlab/diff/parser.rb +++ b/lib/gitlab/diff/parser.rb @@ -17,16 +17,16 @@ module Gitlab Enumerator.new do |yielder| @lines.each do |line| next if filename?(line) - + full_line = line.delete("\n") - + if line.match(/^@@ -/) type = "match" - + 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 yielder << Gitlab::Diff::Line.new(full_line, type, line_obj_index, line_old, line_new) line_obj_index += 1 next @@ -39,8 +39,8 @@ module Gitlab yielder << Gitlab::Diff::Line.new(full_line, type, line_obj_index, line_old, line_new) line_obj_index += 1 end - - + + case line[0] when "+" line_new += 1 diff --git a/lib/gitlab/gitlab_import/importer.rb b/lib/gitlab/gitlab_import/importer.rb index e32ef8a44c2..3f76ec97977 100644 --- a/lib/gitlab/gitlab_import/importer.rb +++ b/lib/gitlab/gitlab_import/importer.rb @@ -17,7 +17,7 @@ module Gitlab def execute project_identifier = CGI.escape(project.import_source) - #Issues && Comments + # Issues && Comments issues = client.issues(project_identifier) issues.each do |issue| |