From d835fbc79f6cd6f17fc7472af48074805622a573 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Sun, 22 Nov 2015 20:59:31 +0100 Subject: Fix url helpers in RepositoryPush --- lib/gitlab/email/message/repository_push.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/gitlab/email') diff --git a/lib/gitlab/email/message/repository_push.rb b/lib/gitlab/email/message/repository_push.rb index b0af3feee9e..bc8aece733f 100644 --- a/lib/gitlab/email/message/repository_push.rb +++ b/lib/gitlab/email/message/repository_push.rb @@ -16,6 +16,7 @@ module Gitlab @project_id = project_id @recipient = recipient @opts = opts + @urls = Gitlab::Application.routes.url_helpers @author_id = opts.delete(:author_id) @ref = opts.delete(:ref) @@ -85,17 +86,17 @@ module Gitlab def target_url if @action == :push if commits.length > 1 && compare - @notify.namespace_project_compare_url(project_namespace, + @urls.namespace_project_compare_url(project_namespace, project, from: Commit.new(compare.base, project), to: Commit.new(compare.head, project)) else - @notify.namespace_project_commit_url(project_namespace, + @urls.namespace_project_commit_url(project_namespace, project, commits.first) end else unless @action == :delete - @notify.namespace_project_tree_url(project_namespace, + @urls.namespace_project_tree_url(project_namespace, project, ref_name) end end -- cgit v1.2.1