debian-mirror-gitlab/lib/api/entities/commit.rb

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

22 lines
577 B
Ruby
Raw Normal View History

2020-03-13 15:44:24 +05:30
# frozen_string_literal: true
module API
module Entities
class Commit < Grape::Entity
expose :id, :short_id, :created_at
expose :parent_ids
expose :full_title, as: :title
expose :safe_message, as: :message
expose :author_name, :author_email, :authored_date
expose :committer_name, :committer_email, :committed_date
2021-09-04 01:27:46 +05:30
expose :trailers
2020-04-08 14:13:33 +05:30
expose :web_url do |commit, _options|
2022-09-01 20:07:04 +05:30
c = commit
c = c.__subject__ if c.is_a?(Gitlab::View::Presenter::Base)
Gitlab::UrlBuilder.build(c)
2020-04-08 14:13:33 +05:30
end
2020-03-13 15:44:24 +05:30
end
end
end