summaryrefslogtreecommitdiff
path: root/lib/gitlab_update.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-14 11:20:40 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-14 11:20:40 +0200
commitba68af63031a396df644807e1a428b5364f457da (patch)
tree30af56c594b2a5d1ebd8af45cde0bf219826b6e7 /lib/gitlab_update.rb
parenteeb00757d4f7f057941de9d30cfd4ff74827f626 (diff)
downloadgitlab-shell-ba68af63031a396df644807e1a428b5364f457da.tar.gz
If GL_USER set with some garbage - reset it
Diffstat (limited to 'lib/gitlab_update.rb')
-rw-r--r--lib/gitlab_update.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab_update.rb b/lib/gitlab_update.rb
index 8a403a5..7bbb288 100644
--- a/lib/gitlab_update.rb
+++ b/lib/gitlab_update.rb
@@ -18,6 +18,13 @@ class GitlabUpdate
# without validation of access
exit 0 if @key_id.nil?
+ # Also skip update hook for non-gitlab keys
+ # and reset GL_USER env
+ unless @key_id =~ /\Akey\-\d+\Z/
+ ENV['GL_USER'] = nil
+ exit 0
+ end
+
if api.allowed?('git-receive-pack', @repo_name, @key_id, @refname)
exit 0
else