summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gitlab/git/hook.rb3
-rw-r--r--lib/gitlab/git_access.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab/git/hook.rb b/lib/gitlab/git/hook.rb
index 125240c8a8b..57c41b41298 100644
--- a/lib/gitlab/git/hook.rb
+++ b/lib/gitlab/git/hook.rb
@@ -1,6 +1,7 @@
module Gitlab
module Git
class Hook
+ GL_PROTOCOL = 'web'.freeze
attr_reader :name, :repo_path, :path
def initialize(name, repo_path)
@@ -35,7 +36,7 @@ module Gitlab
vars = {
'GL_ID' => gl_id,
'PWD' => repo_path,
- 'GL_PROTOCOL' => 'web'
+ 'GL_PROTOCOL' => GL_PROTOCOL
}
options = {
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb
index d5f2713e935..beec56fcc62 100644
--- a/lib/gitlab/git_access.rb
+++ b/lib/gitlab/git_access.rb
@@ -50,7 +50,7 @@ module Gitlab
end
def check(cmd, changes = nil)
- return build_status_object(false, 'Access denied due to unspecified Git access protocol') unless protocol
+ raise 'Access denied due to unspecified Git access protocol' unless protocol
return build_status_object(false, "Git access over #{protocol.upcase} is not allowed") unless protocol_allowed?