diff options
author | Sean McGivern <sean@gitlab.com> | 2016-12-26 15:03:05 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-12-26 16:25:55 +0000 |
commit | 1e5e56c698740e049a3fcf7b578ac006d5deef42 (patch) | |
tree | 19d70223083a60d00ca53785a853ad44702fbee0 /lib | |
parent | ed6900caf107ad0fc4580ad7dc000284d91683d4 (diff) | |
download | gitlab-ce-1e5e56c698740e049a3fcf7b578ac006d5deef42.tar.gz |
Fix MR with files hidden by .gitattributes25931-gitlab-merge-request-view-crash-when-commiting-a-js-sourcemap-file
Don't try to highlight and cache files hidden by .gitattributes entries.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/diff/file_collection/merge_request_diff.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/diff/file_collection/merge_request_diff.rb b/lib/gitlab/diff/file_collection/merge_request_diff.rb index 56530448f36..329d12f13d1 100644 --- a/lib/gitlab/diff/file_collection/merge_request_diff.rb +++ b/lib/gitlab/diff/file_collection/merge_request_diff.rb @@ -61,7 +61,10 @@ module Gitlab end def cacheable?(diff_file) - @merge_request_diff.present? && diff_file.blob && diff_file.blob.text? + @merge_request_diff.present? && + diff_file.blob && + diff_file.blob.text? && + @project.repository.diffable?(diff_file.blob) end def cache_key |