summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-14 16:34:10 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-14 16:34:10 +0000
commitbfa4e0b43c216ba5f3201058668d3a65743a9910 (patch)
tree2265d2644cc8821128a3de731aff762b14564690 /lib
parent6689552c4793623a9d47986328a0379ab215f9bc (diff)
downloadgitlab-ce-bfa4e0b43c216ba5f3201058668d3a65743a9910.tar.gz
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/git/pre_receive_error.rb10
-rw-r--r--lib/gitlab/gitaly_client/operation_service.rb2
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/gitlab/git/pre_receive_error.rb b/lib/gitlab/git/pre_receive_error.rb
index 7a6f27179f0..b84ac656927 100644
--- a/lib/gitlab/git/pre_receive_error.rb
+++ b/lib/gitlab/git/pre_receive_error.rb
@@ -18,13 +18,15 @@ module Gitlab
attr_reader :raw_message
- def initialize(message = '', user_message = '')
+ def initialize(message = '', fallback_message: '')
@raw_message = message
- if user_message.present?
- super(sanitize(user_message))
+ sanitized_msg = sanitize(message)
+
+ if sanitized_msg.present?
+ super(sanitized_msg)
else
- super(sanitize(message))
+ super(fallback_message)
end
end
diff --git a/lib/gitlab/gitaly_client/operation_service.rb b/lib/gitlab/gitaly_client/operation_service.rb
index 513063c60d2..786eb3ca4ae 100644
--- a/lib/gitlab/gitaly_client/operation_service.rb
+++ b/lib/gitlab/gitaly_client/operation_service.rb
@@ -179,7 +179,7 @@ module Gitlab
)
if response.pre_receive_error.present?
- raise Gitlab::Git::PreReceiveError.new(response.pre_receive_error, "GL-HOOK-ERR: pre-receive hook failed.")
+ raise Gitlab::Git::PreReceiveError.new(response.pre_receive_error, fallback_message: "pre-receive hook failed.")
end
Gitlab::Git::OperationService::BranchUpdate.from_gitaly(response.branch_update)