summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-05-17 12:31:44 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-05-18 14:14:31 +0200
commitbc5aea42748633013a3e50d699a1b58281404d47 (patch)
tree322b4b5a8e30f16c5c7693639f299bbbb1ca782b /hooks
parentaa1a39a927b2810c07d23920d5035c6143d8c9cc (diff)
downloadgitlab-shell-zj-repo-disk-path-removal.tar.gz
Internal allowed response disk path is ignoredzj-repo-disk-path-removal
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/post-receive5
-rwxr-xr-xhooks/pre-receive6
2 files changed, 5 insertions, 6 deletions
diff --git a/hooks/post-receive b/hooks/post-receive
index 30f4be1..fb4f5ab 100755
--- a/hooks/post-receive
+++ b/hooks/post-receive
@@ -6,13 +6,12 @@
refs = $stdin.read
key_id = ENV.delete('GL_ID')
gl_repository = ENV['GL_REPOSITORY']
-repo_path = Dir.pwd
require_relative '../lib/gitlab_custom_hook'
require_relative '../lib/gitlab_post_receive'
-if GitlabPostReceive.new(gl_repository, repo_path, key_id, refs).exec &&
- GitlabCustomHook.new(repo_path, key_id).post_receive(refs)
+if GitlabPostReceive.new(gl_repository, key_id, refs).exec &&
+ GitlabCustomHook.new(Dir.pwd, key_id).post_receive(refs)
exit 0
else
exit 1
diff --git a/hooks/pre-receive b/hooks/pre-receive
index 58a628b..7ee81a4 100755
--- a/hooks/pre-receive
+++ b/hooks/pre-receive
@@ -9,7 +9,7 @@ protocol = ENV.delete('GL_PROTOCOL')
repo_path = Dir.pwd
gl_repository = ENV['GL_REPOSITORY']
-def increase_reference_counter(gl_repository, repo_path)
+def increase_reference_counter(gl_repository)
result = GitlabNet.new.pre_receive(gl_repository)
result['reference_counter_increased']
@@ -23,9 +23,9 @@ require_relative '../lib/gitlab_net'
# last so that it only runs if everything else succeeded. On post-receive on the
# other hand, we run GitlabPostReceive first because the push is already done
# and we don't want to skip it if the custom hook fails.
-if GitlabAccess.new(gl_repository, repo_path, key_id, refs, protocol).exec &&
+if GitlabAccess.new(gl_repository, key_id, refs, protocol).exec &&
GitlabCustomHook.new(repo_path, key_id).pre_receive(refs) &&
- increase_reference_counter(gl_repository, repo_path)
+ increase_reference_counter(gl_repository)
exit 0
else
exit 1