summaryrefslogtreecommitdiff
path: root/app/workers/post_receive.rb
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-10-25 11:09:53 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-10-25 11:36:26 +0100
commit679d9b21b7aac55796ef59d5694b7d2e0fb40b35 (patch)
tree0ce28ce2326a231aa2c65d324dea9168c17b024d /app/workers/post_receive.rb
parentf8ee07d9ee6d01b255902ad976a07beef59a95fb (diff)
downloadgitlab-ce-679d9b21b7aac55796ef59d5694b7d2e0fb40b35.tar.gz
Removes idenfitication by commit from Gitlab::Identifier51335-fail-early-when-user-cannot-be-identified
Before we would need to identify a user when pushing through the GitLab UI. Since this is no longer the case we can remove the identification by commit and instead, use the identify_using_user
Diffstat (limited to 'app/workers/post_receive.rb')
-rw-r--r--app/workers/post_receive.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb
index 207eef6229f..72a1733a2a8 100644
--- a/app/workers/post_receive.rb
+++ b/app/workers/post_receive.rb
@@ -31,10 +31,12 @@ class PostReceive
refs = Set.new
@user = post_received.identify
- post_received.changes_refs do |oldrev, newrev, ref|
- @user ||= post_received.identify(newrev)
- break unless @user
+ unless @user
+ log("Triggered hook for non-existing user \"#{post_received.identifier}\"")
+ return false
+ end
+ post_received.changes_refs do |oldrev, newrev, ref|
if Gitlab::Git.tag_ref?(ref)
GitTagPushService.new(post_received.project, @user, oldrev: oldrev, newrev: newrev, ref: ref).execute
elsif Gitlab::Git.branch_ref?(ref)
@@ -45,11 +47,6 @@ class PostReceive
refs << ref
end
- unless @user
- log("Triggered hook for non-existing user \"#{post_received.identifier}\"")
- return false
- end
-
after_project_changes_hooks(post_received, @user, refs.to_a, changes)
end