diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-14 11:20:40 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-14 11:20:40 +0200 |
commit | ba68af63031a396df644807e1a428b5364f457da (patch) | |
tree | 30af56c594b2a5d1ebd8af45cde0bf219826b6e7 | |
parent | eeb00757d4f7f057941de9d30cfd4ff74827f626 (diff) | |
download | gitlab-shell-ba68af63031a396df644807e1a428b5364f457da.tar.gz |
If GL_USER set with some garbage - reset it
-rw-r--r-- | lib/gitlab_update.rb | 7 |
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 |