summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjose <jose.kahan@w3.org>2014-10-30 18:05:53 +0100
committerjose <jose.kahan@w3.org>2014-10-30 18:05:53 +0100
commitf25e8e140d8bddf453f3d827f4a0787730d2f813 (patch)
treef723653f3d4349beea7a18856b1f74d1b269cc60
parentcc193ea45d8d0651fe09fc93bb1417eaac50c2ff (diff)
downloadgitlab-shell-f25e8e140d8bddf453f3d827f4a0787730d2f813.tar.gz
The gitlab pre-receive hook expects the call to exec to return 1
when a user has access. Doing an exit 0 effectively ended the thread. No code would be executed after the call to exec. This changes fixes the problem for the pre-receive hooks but you want to check that GitlabAccess.exec is not used elsewhere. A quick grep of the code seems to indicate this is not the case
-rw-r--r--lib/gitlab_access.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab_access.rb b/lib/gitlab_access.rb
index 80c050c..ee7a94a 100644
--- a/lib/gitlab_access.rb
+++ b/lib/gitlab_access.rb
@@ -18,7 +18,7 @@ class GitlabAccess
def exec
if api.allowed?('git-receive-pack', @repo_name, @actor, @changes)
- exit 0
+ return 1
else
# reset GL_ID env since we stop git push here
ENV['GL_ID'] = nil