summaryrefslogtreecommitdiff
path: root/lib/api/branches.rb
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-02-07 15:16:46 +0100
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-02-07 15:16:46 +0100
commit128b1eae092e4ee9384c99a4ba72b9122fc17e89 (patch)
tree8eab2084903f6455c40e969cbc3d8ef02582288e /lib/api/branches.rb
parent68db614d17c3ad984f7a5698d02475f71bde8941 (diff)
downloadgitlab-ce-128b1eae092e4ee9384c99a4ba72b9122fc17e89.tar.gz
Update Rubocop to ruby 2.3zj-drop-ruby-21-tests
Diffstat (limited to 'lib/api/branches.rb')
-rw-r--r--lib/api/branches.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/branches.rb b/lib/api/branches.rb
index be659fa4a6a..9331be1f7de 100644
--- a/lib/api/branches.rb
+++ b/lib/api/branches.rb
@@ -84,7 +84,7 @@ module API
branch = user_project.repository.find_branch(params[:branch])
not_found!("Branch") unless branch
protected_branch = user_project.protected_branches.find_by(name: branch.name)
- protected_branch.destroy if protected_branch
+ protected_branch&.destroy
present branch, with: Entities::RepoBranch, project: user_project
end