diff options
Diffstat (limited to 'app/workers/post_receive.rb')
-rw-r--r-- | app/workers/post_receive.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb index 6e2d0e7aba2..e3f62d736ef 100644 --- a/app/workers/post_receive.rb +++ b/app/workers/post_receive.rb @@ -5,10 +5,10 @@ class PostReceive def perform(repo_path, oldrev, newrev, ref, identifier) - if repo_path.start_with?(Gitlab.config.gitolite.repos_path.to_s) - repo_path.gsub!(Gitlab.config.gitolite.repos_path.to_s, "") + if repo_path.start_with?(Gitlab.config.gitlab_shell.repos_path.to_s) + repo_path.gsub!(Gitlab.config.gitlab_shell.repos_path.to_s, "") else - Gitlab::GitLogger.error("POST-RECEIVE: Check gitlab.yml config for correct gitolite.repos_path variable. \"#{Gitlab.config.gitolite.repos_path}\" does not match \"#{repo_path}\"") + Gitlab::GitLogger.error("POST-RECEIVE: Check gitlab.yml config for correct gitlab_shell.repos_path variable. \"#{Gitlab.config.gitlab_shell.repos_path}\" does not match \"#{repo_path}\"") end repo_path.gsub!(/.git$/, "") @@ -22,7 +22,8 @@ class PostReceive end # Ignore push from non-gitlab users - user = if identifier.eql? Gitlab.config.gitolite.admin_key + user = if identifier.nil? + raise identifier.inspect email = project.repository.commit(newrev).author.email rescue nil User.find_by_email(email) if email elsif /^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier) |