diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2016-11-10 20:24:12 +0300 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2016-11-10 20:24:12 +0300 |
commit | 3fa265d19547669c60788e38e389fa12bb119235 (patch) | |
tree | e796b5286824892269c836cb75ce11a479a6472a /lib | |
parent | e3dcd83d4a4b75dc050592ea008dc34ecbe0aa49 (diff) |
Fix expanding a collapsed diff when converting a symlink to a regular file
In this case comparing old_path and new_path is not enough because there
are two entires that match.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/diff/file.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/diff/file_collection/merge_request_diff.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb index ce85e5e0123..5110bfbf898 100644 --- a/lib/gitlab/diff/file.rb +++ b/lib/gitlab/diff/file.rb @@ -126,7 +126,7 @@ module Gitlab repository.blob_at(commit.id, file_path) end - def cache_key + def file_identifier "#{file_path}-#{new_file}-#{deleted_file}-#{renamed_file}" end end diff --git a/lib/gitlab/diff/file_collection/merge_request_diff.rb b/lib/gitlab/diff/file_collection/merge_request_diff.rb index dc4d47c878b..fe7adb7bed6 100644 --- a/lib/gitlab/diff/file_collection/merge_request_diff.rb +++ b/lib/gitlab/diff/file_collection/merge_request_diff.rb @@ -39,7 +39,7 @@ module Gitlab # hashes that represent serialized diff lines. # def cache_highlight!(diff_file) - item_key = diff_file.cache_key + item_key = diff_file.file_identifier if highlight_cache[item_key] highlight_diff_file_from_cache!(diff_file, highlight_cache[item_key]) |