debian-mirror-gitlab/lib/gitlab/diff/file_collection/compare.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
856 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2016-09-13 17:45:13 +05:30
module Gitlab
module Diff
module FileCollection
class Compare < Base
2023-03-04 22:38:38 +05:30
delegate :limit_value, :current_page, :next_page, :prev_page, :total_count, :total_pages, to: :@pagination
2016-09-13 17:45:13 +05:30
def initialize(compare, project:, diff_options:, diff_refs: nil)
2023-03-04 22:38:38 +05:30
@pagination = Gitlab::PaginationDelegate.new(
page: diff_options&.delete(:page),
per_page: diff_options&.delete(:per_page),
count: diff_options&.delete(:count)
)
2016-09-13 17:45:13 +05:30
super(compare,
2022-10-11 01:57:18 +05:30
project: project,
2016-09-13 17:45:13 +05:30
diff_options: diff_options,
2022-10-11 01:57:18 +05:30
diff_refs: diff_refs)
2016-09-13 17:45:13 +05:30
end
2019-02-15 15:39:39 +05:30
def unfold_diff_lines(positions)
# no-op
end
2021-09-30 23:02:18 +05:30
def cache_key
['compare', @diffable.head.id, @diffable.base.id]
end
2016-09-13 17:45:13 +05:30
end
end
end
end