diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-05-02 18:15:12 -0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-05-05 10:51:55 -0300 |
commit | 5249157552bbf4cbf279b1decbd4a0e90e056077 (patch) | |
tree | 250c360fcc3e6c435713421bf95df7d8d9e9ab6d /lib | |
parent | c45341c816d78d51aee84a6068d778b9cbc502c8 (diff) | |
download | gitlab-ce-5249157552bbf4cbf279b1decbd4a0e90e056077.tar.gz |
Allow gl-repository strings as project identifiers in PostReceive worker
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git_post_receive.rb | 29 |
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 |