diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-06-20 21:57:37 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-07-05 18:03:29 -0500 |
commit | fd41b8a433164f36f7cf70b358115c5f56f06670 (patch) | |
tree | c5bf7d25769590aca26dba99626a6c51ef498508 /hooks | |
parent | 1c18095c9f2b80d380122c8c71f98a07387c1e66 (diff) | |
download | gitlab-shell-fd41b8a433164f36f7cf70b358115c5f56f06670.tar.gz |
Simplify protocol assign, and populate ENV['PROTOCOL'] variable when calling hooks via SSH
Diffstat (limited to 'hooks')
-rwxr-xr-x | hooks/pre-receive | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/hooks/pre-receive b/hooks/pre-receive index 6ed9a2c..a7eeb30 100755 --- a/hooks/pre-receive +++ b/hooks/pre-receive @@ -5,14 +5,12 @@ refs = $stdin.read key_id = ENV['GL_ID'] -protocol = ENV['PROTOCOL'] +protocol = ENV['PROTOCOL'] || 'http' repo_path = Dir.pwd require_relative '../lib/gitlab_custom_hook' require_relative '../lib/gitlab_access' -protocol ||= 'http' - if GitlabAccess.new(repo_path, key_id, refs, protocol).exec && GitlabCustomHook.new.pre_receive(refs, repo_path) exit 0 |