diff options
author | Valery Sizov <valery@gitlab.com> | 2014-11-24 12:04:01 +0000 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2014-11-24 12:04:01 +0000 |
commit | c5a7b76cc24e75e7024341e3cef248d7e53e2364 (patch) | |
tree | 484912f3b5b690c67080fd0b2d564c3dfb67924d /lib/gitlab_access.rb | |
parent | f8453da5868dd7a23d0f2f3da7a45e33c441d1db (diff) | |
parent | 961fe45c4210dcb1a69f167ac468991ad6998793 (diff) | |
download | gitlab-shell-c5a7b76cc24e75e7024341e3cef248d7e53e2364.tar.gz |
Merge branch 'git_messages' into 'master'
Better git hook messages
DZ already merged it but we had to revert it because of lack of time to deploy to dev.
See merge request !48
Diffstat (limited to 'lib/gitlab_access.rb')
-rw-r--r-- | lib/gitlab_access.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/gitlab_access.rb b/lib/gitlab_access.rb index 78d353c..547b81d 100644 --- a/lib/gitlab_access.rb +++ b/lib/gitlab_access.rb @@ -1,5 +1,6 @@ require_relative 'gitlab_init' require_relative 'gitlab_net' +require_relative 'gitlab_access_status' require_relative 'names_helper' require 'json' @@ -17,13 +18,14 @@ class GitlabAccess end def exec - if api.allowed?('git-receive-pack', @repo_name, @actor, @changes) - return true + status = api.check_access('git-receive-pack', @repo_name, @actor, @changes) + if status.allowed? + true else # reset GL_ID env since we stop git push here ENV['GL_ID'] = nil - puts "GitLab: You are not allowed to access some of the refs!" - return false + puts "GitLab: #{status.message}" + false end end |