summaryrefslogtreecommitdiff
path: root/lib/api/entities
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-08-26 14:36:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-26 14:36:54 +0000
commitdaf5ae5bd439f1f32363d410129d5b9e73fbb539 (patch)
tree6d670487dc3dccf1a0c3e6b8337e5b4ab9da4ee9 /lib/api/entities
parent6e8c2290dab8ae1612dff80e312911bc1147edaa (diff)
downloadgitlab-ce-daf5ae5bd439f1f32363d410129d5b9e73fbb539.tar.gz
Add latest changes from gitlab-org/security/gitlab@15-3-stable-ee
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|