From f5847911ca12534c18fe97b9d0c035d19cf2cfb2 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Fri, 21 Dec 2018 23:41:37 +0000 Subject: Bump Gitaly version to v1.12.0 --- GITALY_SERVER_VERSION | 2 +- lib/api/helpers.rb | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index f8e233b2733..0eed1a29efd 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -1.9.0 +1.12.0 diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index a7d67a6300e..c3eca713712 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -163,9 +163,11 @@ module API end def find_branch!(branch_name) - user_project.repository.find_branch(branch_name) || not_found!('Branch') - rescue Gitlab::Git::CommandError - render_api_error!('The branch refname is invalid', 400) + if Gitlab::GitRefValidator.validate(branch_name) + user_project.repository.find_branch(branch_name) || not_found!('Branch') + else + render_api_error!('The branch refname is invalid', 400) + end end def find_project_label(id) -- cgit v1.2.1