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:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-05-03 00:15:12 +0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-05-05 16:51:55 +0300
commit5249157552bbf4cbf279b1decbd4a0e90e056077 (patch)
tree250c360fcc3e6c435713421bf95df7d8d9e9ab6d /lib/gitlab/git_post_receive.rb
parentc45341c816d78d51aee84a6068d778b9cbc502c8 (diff)
Allow gl-repository strings as project identifiers in PostReceive worker
Diffstat (limited to 'lib/gitlab/git_post_receive.rb')
-rw-r--r--lib/gitlab/git_post_receive.rb29
1 files changed, 3 insertions, 26 deletions
diff --git a/lib/gitlab/git_post_receive.rb b/lib/gitlab/git_post_receive.rb
index 6babea144c7..0e14253ab4e 100644
--- a/lib/gitlab/git_post_receive.rb
+++ b/lib/gitlab/git_post_receive.rb
@@ -1,25 +1,12 @@
module Gitlab
class GitPostReceive
include Gitlab::Identifier
- attr_reader :repo_path, :identifier, :changes, :project
+ attr_reader :project, :identifier, :changes
- def initialize(repo_path, identifier, changes)
- repo_path.gsub!(/\.git\z/, '')
- repo_path.gsub!(/\A\//, '')
-
- @repo_path = repo_path
+ def initialize(project, identifier, changes)
+ @project = project
@identifier = identifier
@changes = deserialize_changes(changes)
-
- retrieve_project_and_type
- end
-
- def wiki?
- @type == :wiki
- end
-
- def regular_project?
- @type == :project
end
def identify(revision)
@@ -28,16 +15,6 @@ module Gitlab
private
- def retrieve_project_and_type
- @type = :project
- @project = Project.find_by_full_path(@repo_path)
-
- if @repo_path.end_with?('.wiki') && !@project
- @type = :wiki
- @project = Project.find_by_full_path(@repo_path.gsub(/\.wiki\z/, ''))
- end
- end
-
def deserialize_changes(changes)
changes = utf8_encode_changes(changes)
changes.lines