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:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-10-25 13:09:53 +0300
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-10-25 13:36:26 +0300
commit679d9b21b7aac55796ef59d5694b7d2e0fb40b35 (patch)
tree0ce28ce2326a231aa2c65d324dea9168c17b024d /lib/gitlab/identifier.rb
parentf8ee07d9ee6d01b255902ad976a07beef59a95fb (diff)
Removes idenfitication by commit from Gitlab::Identifier
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 'lib/gitlab/identifier.rb')
-rw-r--r--lib/gitlab/identifier.rb21
1 files changed, 3 insertions, 18 deletions
diff --git a/lib/gitlab/identifier.rb b/lib/gitlab/identifier.rb
index 28a9fe29465..d5f94ad04f1 100644
--- a/lib/gitlab/identifier.rb
+++ b/lib/gitlab/identifier.rb
@@ -1,13 +1,11 @@
# frozen_string_literal: true
# Detect user based on identifier like
-# key-13 or user-36 or last commit
+# key-13 or user-36
module Gitlab
module Identifier
- def identify(identifier, project = nil, newrev = nil)
- if identifier.blank?
- identify_using_commit(project, newrev)
- elsif identifier =~ /\Auser-\d+\Z/
+ def identify(identifier)
+ if identifier =~ /\Auser-\d+\Z/
# git push over http
identify_using_user(identifier)
elsif identifier =~ /\Akey-\d+\Z/
@@ -16,19 +14,6 @@ module Gitlab
end
end
- # Tries to identify a user based on a commit SHA.
- def identify_using_commit(project, ref)
- return if project.nil? && ref.nil?
-
- commit = project.commit(ref)
-
- return if !commit || !commit.author_email
-
- identify_with_cache(:email, commit.author_email) do
- commit.author
- end
- end
-
# Tries to identify a user based on a user identifier (e.g. "user-123").
# rubocop: disable CodeReuse/ActiveRecord
def identify_using_user(identifier)