summaryrefslogtreecommitdiff
path: root/lib/api/entities
diff options
context:
space:
mode:
authorGitLab Release Tools Bot <delivery-team+release-tools@gitlab.com>2022-08-30 15:09:23 +0000
committerGitLab Release Tools Bot <delivery-team+release-tools@gitlab.com>2022-08-30 15:09:23 +0000
commit33d3043f0f3b825f98c7ff2c794208a79bcafdb3 (patch)
tree2fc8f97f12f9e3049ed3daad5700ae438b7eac9b /lib/api/entities
parent99e4792893862d913d0bc9168da7d85775445590 (diff)
parentf1452cd5cf4c3e2dd6697bc25636b49c1aadecd1 (diff)
downloadgitlab-ce-15-1-stable.tar.gz
Merge remote-tracking branch 'dev/15-1-stable' into 15-1-stable15-1-stable
Diffstat (limited to 'lib/api/entities')
-rw-r--r--lib/api/entities/commit.rb4
-rw-r--r--lib/api/entities/commit_detail.rb6
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/api/entities/commit.rb b/lib/api/entities/commit.rb
index fd23c23b980..6cd180cd584 100644
--- a/lib/api/entities/commit.rb
+++ b/lib/api/entities/commit.rb
@@ -12,7 +12,9 @@ module API
expose :trailers
expose :web_url do |commit, _options|
- Gitlab::UrlBuilder.build(commit)
+ c = commit
+ c = c.__subject__ if c.is_a?(Gitlab::View::Presenter::Base)
+ Gitlab::UrlBuilder.build(c)
end
end
end
diff --git a/lib/api/entities/commit_detail.rb b/lib/api/entities/commit_detail.rb
index 61238102e9d..cc529639359 100644
--- a/lib/api/entities/commit_detail.rb
+++ b/lib/api/entities/commit_detail.rb
@@ -3,8 +3,10 @@
module API
module Entities
class CommitDetail < Commit
- expose :stats, using: Entities::CommitStats, if: :stats
- expose :status
+ include ::API::Helpers::Presentable
+
+ expose :stats, using: Entities::CommitStats, if: :include_stats
+ expose :status_for, as: :status
expose :project_id
expose :last_pipeline do |commit, options|