summaryrefslogtreecommitdiff
path: root/lib/hooks_utils.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-12-14 09:37:37 +0000
committerDouwe Maan <douwe@gitlab.com>2018-12-14 09:37:37 +0000
commit4581f9d89be721bf853ceac433c2492dd9438c5a (patch)
tree69198bb4580416a9aa2af1473d80e108a997ce5d /lib/hooks_utils.rb
parentcdd9e12beb06354ff0babfb18907d3f184bac547 (diff)
parente4d62acc8d0c1325e6451ce222e7f4d5bdd55fc7 (diff)
downloadgitlab-shell-4581f9d89be721bf853ceac433c2492dd9438c5a.tar.gz
Merge branch 'handle-push-options' into 'master'
Handle push options See merge request gitlab-org/gitlab-shell!166
Diffstat (limited to 'lib/hooks_utils.rb')
-rw-r--r--lib/hooks_utils.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/hooks_utils.rb b/lib/hooks_utils.rb
new file mode 100644
index 0000000..b11317c
--- /dev/null
+++ b/lib/hooks_utils.rb
@@ -0,0 +1,15 @@
+module HooksUtils
+ module_function
+
+ # Gets an array of Git push options from the environment
+ def get_push_options
+ count = ENV['GIT_PUSH_OPTION_COUNT'].to_i
+ result = []
+
+ count.times do |i|
+ result.push(ENV["GIT_PUSH_OPTION_#{i}"])
+ end
+
+ result
+ end
+end