diff options
author | Rémy Coutable <remy@rymai.me> | 2016-04-12 17:04:40 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-04-12 17:04:40 +0300 |
commit | a5512099cec6219261ac821775f0cc02e99bc1a6 (patch) | |
tree | c9d2b8995d86fc76d349201baf1e2ca6e6176af5 /lib | |
parent | 01d4995ae6aad70d9d74f5ed5e3983a1f38b5d34 (diff) | |
parent | 08a217cfcfc2e2387c6d4070ed8b0e121f47f50c (diff) |
Merge branch 'api-get-tag' into 'master'
API: Ability to retrieve a single tag
* Closes #14330
/cc @dblessing
See merge request !3577
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/tags.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/api/tags.rb b/lib/api/tags.rb index 2d8a9e51bb9..d1a10479e44 100644 --- a/lib/api/tags.rb +++ b/lib/api/tags.rb @@ -16,6 +16,20 @@ module API with: Entities::RepoTag, project: user_project end + # Get a single repository tag + # + # Parameters: + # id (required) - The ID of a project + # tag_name (required) - The name of the tag + # Example Request: + # GET /projects/:id/repository/tags/:tag_name + get ":id/repository/tags/:tag_name", requirements: { tag_name: /.+/ } do + tag = user_project.repository.find_tag(params[:tag_name]) + not_found!('Tag') unless tag + + present tag, with: Entities::RepoTag, project: user_project + end + # Create tag # # Parameters: |