5a3e6fdff9
This commit, introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23812, fixes a problem creating a displaying image diff notes when the image is stored in LFS. The main problem was that `Gitlab::Diff::File` was returning an invalid valid in `text?` for this kind of files. It also fixes a rendering problem with other LFS files, like text ones. They LFS pointer shouldn't be shown when LFS is enabled for the project, but they were.
50 lines
528 B
Ruby
50 lines
528 B
Ruby
# frozen_string_literal: true
|
|
|
|
module BlobLike
|
|
extend ActiveSupport::Concern
|
|
include Gitlab::BlobHelper
|
|
|
|
def id
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def name
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def path
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def size
|
|
0
|
|
end
|
|
|
|
def data
|
|
nil
|
|
end
|
|
|
|
def mode
|
|
nil
|
|
end
|
|
|
|
def binary_in_repo?
|
|
false
|
|
end
|
|
|
|
def load_all_data!(repository)
|
|
# No-op
|
|
end
|
|
|
|
def truncated?
|
|
false
|
|
end
|
|
|
|
def external_storage
|
|
nil
|
|
end
|
|
|
|
def external_size
|
|
nil
|
|
end
|
|
end
|