summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2017-10-24 13:28:06 +0300
committerRobert Schilling <rschilling@student.tugraz.at>2017-10-24 13:28:06 +0300
commit58617553e66b4492eee84d320fdc3d65f93d069e (patch)
tree0c84d50d034f26811c1a9bbcce4d45bdb915fcce /lib/api/entities.rb
parent82446a2bd009e7d7481c35a142063a3973be77ce (diff)
downloadgitlab-ce-api-refs-for-commit.tar.gz
Basic ref fetching for commitsapi-refs-for-commit
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 5f0bad14839..ad3ca18db3c 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -238,7 +238,11 @@ module API
expose :last_pipeline, using: 'API::Entities::PipelineBasic'
end
- class Branch < Grape::Entity
+ class BasicRef < Grape::Entity
+ expose :name
+ end
+
+ class Branch < BasicRef
expose :name
expose :commit, using: Entities::Commit do |repo_branch, options|
@@ -774,8 +778,8 @@ module API
expose :description
end
- class Tag < Grape::Entity
- expose :name, :message
+ class Tag < BasicRef
+ expose :message
expose :commit, using: Entities::Commit do |repo_tag, options|
options[:project].repository.commit(repo_tag.dereferenced_target)