Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJeroen Nijhof <jeroen@jeroennijhof.nl>2016-01-08 19:25:09 +0300
committerJeroen Nijhof <jeroen@jeroennijhof.nl>2016-01-08 19:25:09 +0300
commite0436005af0d567391031ebbf546877f7f525731 (patch)
tree7a65d829d33043a0dadd7f8fcda910542e7d2406 /lib
parent2c37ae2f0a7612deb4bf93fb726c98cad60ca0aa (diff)
parentc1e974ed889dd31fbbddfa2daeb1a681043d5aa0 (diff)
Merge gitlab.com:gitlab-org/gitlab-ce
Diffstat (limited to 'lib')
-rw-r--r--lib/api/tags.rb21
-rw-r--r--lib/gitlab/current_settings.rb3
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/api/tags.rb b/lib/api/tags.rb
index 47621f443e6..2d8a9e51bb9 100644
--- a/lib/api/tags.rb
+++ b/lib/api/tags.rb
@@ -40,6 +40,27 @@ module API
end
end
+ # Delete tag
+ #
+ # Parameters:
+ # id (required) - The ID of a project
+ # tag_name (required) - The name of the tag
+ # Example Request:
+ # DELETE /projects/:id/repository/tags/:tag
+ delete ":id/repository/tags/:tag_name", requirements: { tag_name: /.*/ } do
+ authorize_push_project
+ result = DeleteTagService.new(user_project, current_user).
+ execute(params[:tag_name])
+
+ if result[:status] == :success
+ {
+ tag_name: params[:tag_name]
+ }
+ else
+ render_api_error!(result[:message], result[:return_code])
+ end
+ end
+
# Add release notes to tag
#
# Parameters:
diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb
index 7a86c09158e..7f938780ab1 100644
--- a/lib/gitlab/current_settings.rb
+++ b/lib/gitlab/current_settings.rb
@@ -41,6 +41,9 @@ module Gitlab
use_db && ActiveRecord::Base.connection.active? &&
!ActiveRecord::Migrator.needs_migration? &&
ActiveRecord::Base.connection.table_exists?('application_settings')
+
+ rescue ActiveRecord::NoDatabaseError
+ false
end
end
end