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
diff options
context:
space:
mode:
authorRubén Dávila <ruben@gitlab.com>2015-11-26 03:20:40 +0300
committerRubén Dávila <ruben@gitlab.com>2015-12-03 17:39:15 +0300
commit5145706c82613d64462fe736850d09799224cd77 (patch)
tree81744d6a01be18d3c89c6cb726f8496777b99e4e /app/services/delete_branch_service.rb
parentb5103a83a8574936721250997e75ab9a6855d00a (diff)
Run custom Git hooks when creating or deleting branches through the UI. #1156
Diffstat (limited to 'app/services/delete_branch_service.rb')
-rw-r--r--app/services/delete_branch_service.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/services/delete_branch_service.rb b/app/services/delete_branch_service.rb
index b19b112a0c4..22bf9dd935e 100644
--- a/app/services/delete_branch_service.rb
+++ b/app/services/delete_branch_service.rb
@@ -24,7 +24,7 @@ class DeleteBranchService < BaseService
return error('You dont have push access to repo', 405)
end
- if repository.rm_branch(branch_name)
+ if repository.rm_branch(current_user, branch_name)
push_data = build_push_data(branch)
EventCreateService.new.push(project, current_user, push_data)
@@ -35,6 +35,8 @@ class DeleteBranchService < BaseService
else
error('Failed to remove branch')
end
+ rescue GitHooksService::PreReceiveError
+ error('Branch deletion was rejected by Git hook')
end
def error(message, return_code = 400)