Commit 810d0903 authored by Valeriy Sizov's avatar Valeriy Sizov

Merge branch 'diff_bug'

parents d8833270 bd5334ab
...@@ -21,14 +21,13 @@ module Gitlab ...@@ -21,14 +21,13 @@ module Gitlab
end end
end end
first_token = first_line[0..first_the_same_symbols][1..-1] first_token = first_line[0..first_the_same_symbols][1..-1]
diff_arr[index+1].sub!(first_token, first_token + START) diff_arr[index+1].sub!(first_token, first_token + START)
diff_arr[index+2].sub!(first_token, first_token + START) diff_arr[index+2].sub!(first_token, first_token + START)
last_the_same_symbols = 0 last_the_same_symbols = 0
(1..max_length + 1).each do |i| (1..max_length + 1).each do |i|
last_the_same_symbols = -i last_the_same_symbols = -i
if first_line[-i] != second_line[-i] shortest_line = second_line.size > first_line.size ? first_line : second_line
if ( first_line[-i] != second_line[-i] ) || "#{first_token}#{START}".size == shortest_line[1..-i].size
break break
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment