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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-07 18:07:24 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-07 18:07:24 +0300
commite1e58fabfa768f47ab82f87ba50b1f2793a8258a (patch)
tree1dcb7d67bb70bbfed8e3b1a632db9d9aaf38f85f /app/services/branches
parent9ceb2dbab3296721c576572e96691a19e2506069 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/branches')
-rw-r--r--app/services/branches/create_service.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/services/branches/create_service.rb b/app/services/branches/create_service.rb
index 848e6aaa65a..b5faf2ec281 100644
--- a/app/services/branches/create_service.rb
+++ b/app/services/branches/create_service.rb
@@ -9,12 +9,16 @@ module Branches
return result if result[:status] == :error
- new_branch = repository.add_branch(current_user, branch_name, ref)
+ begin
+ new_branch = repository.add_branch(current_user, branch_name, ref)
+ rescue Gitlab::Git::CommandError => e
+ return error("Failed to create branch '#{branch_name}': #{e}")
+ end
if new_branch
success(new_branch)
else
- error("Invalid reference name: #{ref}")
+ error("Failed to create branch '#{branch_name}': invalid reference name '#{ref}'")
end
rescue Gitlab::Git::PreReceiveError => e
Gitlab::ErrorTracking.track_exception(e, pre_receive_message: e.raw_message, branch_name: branch_name, ref: ref)