Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/post_receive.rb')
-rw-r--r--app/workers/post_receive.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb
index e74379a65dd..a906f78f7e3 100644
--- a/app/workers/post_receive.rb
+++ b/app/workers/post_receive.rb
@@ -13,13 +13,14 @@ class PostReceive
# Ignore push from non-gitlab users
user = if identifier.eql? Gitlab.config.gitolite.admin_key
- email = project.repository.commit(newrev).author.email rescue nil
- User.find_by_email(email) if email
- elsif /^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier)
- User.find_by_email(identifier)
- else
- Key.find_by_identifier(identifier).try(:user)
- end
+ email = project.repository.commit(newrev).author.email rescue nil
+ User.find_by_email(email) if email
+ elsif /^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier)
+ User.find_by_email(identifier)
+ else
+ Key.find_by_identifier(identifier).try(:user)
+ end
+
return false unless user
project.trigger_post_receive(oldrev, newrev, ref, user)