summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-06-20 21:13:53 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-07-05 18:01:12 -0500
commit44e7804ddb408d85f091c7a5cd36e0fdbec63d13 (patch)
tree16956fba9120d6e0fb91fd8b38c55f3c2290c6de /hooks
parent5afdd3f1cc3f12d4e919edb554c755b227675d06 (diff)
downloadgitlab-shell-44e7804ddb408d85f091c7a5cd36e0fdbec63d13.tar.gz
Allow GitLab Shell to check for allowed access based on the used Git protocol.
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/pre-receive5
1 files changed, 4 insertions, 1 deletions
diff --git a/hooks/pre-receive b/hooks/pre-receive
index 1f8a9d5..6ed9a2c 100755
--- a/hooks/pre-receive
+++ b/hooks/pre-receive
@@ -5,12 +5,15 @@
refs = $stdin.read
key_id = ENV['GL_ID']
+protocol = ENV['PROTOCOL']
repo_path = Dir.pwd
require_relative '../lib/gitlab_custom_hook'
require_relative '../lib/gitlab_access'
-if GitlabAccess.new(repo_path, key_id, refs).exec &&
+protocol ||= 'http'
+
+if GitlabAccess.new(repo_path, key_id, refs, protocol).exec &&
GitlabCustomHook.new.pre_receive(refs, repo_path)
exit 0
else