diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-06 13:59:50 +0200 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-06 13:59:50 +0200 |
commit | 7f287c9136d5d1cdda8df170c6e772ca82aad1e9 (patch) | |
tree | 789766ad1b383310fc74b055e6869f1f1698f7bf /lib | |
parent | f76bfed9fc3e52c7b3b731dbb311b6b394d9af62 (diff) | |
download | gitlab-ce-7f287c9136d5d1cdda8df170c6e772ca82aad1e9.tar.gz |
API: Ability to retrieve a single tag
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..731a68082ba 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: |