summaryrefslogtreecommitdiff
path: root/app/workers/post_receive.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-04 16:19:37 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-04 16:19:37 +0200
commit6f7ccea6686d4cc6c6241bc4289c13ff04cc8557 (patch)
tree0bf938ee796ef729ed0f2b66cb57e8957cb76cad /app/workers/post_receive.rb
parent896c3a0a9d4c9ccdfab275d772ae5991dd92865e (diff)
downloadgitlab-ce-6f7ccea6686d4cc6c6241bc4289c13ff04cc8557.tar.gz
Fix satellites to use filesystem. Correct post-receive user finder
Diffstat (limited to 'app/workers/post_receive.rb')
-rw-r--r--app/workers/post_receive.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb
index 6d31c08fefc..17ccfae21ec 100644
--- a/app/workers/post_receive.rb
+++ b/app/workers/post_receive.rb
@@ -28,10 +28,13 @@ class PostReceive
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)
+ User.find_by_username(identifier.strip)
end
- return false unless user
+ unless user
+ Gitlab::GitLogger.error("POST-RECEIVE: Triggered hook for non-existing user \"#{identifier} \"")
+ return false
+ end
project.trigger_post_receive(oldrev, newrev, ref, user)
end