summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-06-23 09:53:21 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-07-05 16:54:22 -0500
commitace309d7755d6d50f85169649429e237ebb32b76 (patch)
tree2a532406604bccadc6b50b9969572fde40d561ac
parent42fb2516d999e64598ac34b92d0a69b068fa7800 (diff)
downloadgitlab-ce-ace309d7755d6d50f85169649429e237ebb32b76.tar.gz
Raise an error if no protocol is passed to the GitAccess check.
-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?