summaryrefslogtreecommitdiff
path: root/lib/gitlab/blame.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/blame.rb')
-rw-r--r--lib/gitlab/blame.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/gitlab/blame.rb b/lib/gitlab/blame.rb
index 5382bdab7eb..78a8f39e143 100644
--- a/lib/gitlab/blame.rb
+++ b/lib/gitlab/blame.rb
@@ -19,16 +19,14 @@ module Gitlab
commit = Commit.new(commit, project)
commit.lazy_author # preload author
- sha = commit.sha
- if prev_sha != sha
+ if prev_sha != commit.sha
groups << current_group if current_group
current_group = { commit: commit, lines: [] }
end
- line = highlighted_lines[i].html_safe if highlight
- current_group[:lines] << line
+ current_group[:lines] << (highlight ? highlighted_lines[i].html_safe : line)
- prev_sha = sha
+ prev_sha = commit.sha
i += 1
end
groups << current_group if current_group