diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2017-10-24 13:28:06 +0300 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2018-02-09 13:25:02 +0100 |
commit | cea2a8f741d623ca2085e8149112de3a20a4779f (patch) | |
tree | 373d81aa73e0baf0f4210e3873ab21583e5a650b /lib/api/entities.rb | |
parent | 7534f7a892d6e8c50475720e387b8689c94582da (diff) | |
download | gitlab-ce-cea2a8f741d623ca2085e8149112de3a20a4779f.tar.gz |
Basic ref fetching for commits
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 7838de13c56..e8c9ba6fce5 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -276,7 +276,17 @@ module API expose :last_pipeline, using: 'API::Entities::PipelineBasic' end - class Branch < Grape::Entity + class BasicRef < Grape::Entity + expose :name + end + + class SimpleRef < Grape::Entity + expose :name do |ref, options| + ref + end + end + + class Branch < BasicRef expose :name expose :commit, using: Entities::Commit do |repo_branch, options| @@ -845,8 +855,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) |