summaryrefslogtreecommitdiff
path: root/lib/api/entities
diff options
context:
space:
mode:
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|