Commit d835fbc7 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix url helpers in RepositoryPush

parent 9f2752e5
...@@ -16,6 +16,7 @@ module Gitlab ...@@ -16,6 +16,7 @@ module Gitlab
@project_id = project_id @project_id = project_id
@recipient = recipient @recipient = recipient
@opts = opts @opts = opts
@urls = Gitlab::Application.routes.url_helpers
@author_id = opts.delete(:author_id) @author_id = opts.delete(:author_id)
@ref = opts.delete(:ref) @ref = opts.delete(:ref)
...@@ -85,17 +86,17 @@ module Gitlab ...@@ -85,17 +86,17 @@ module Gitlab
def target_url def target_url
if @action == :push if @action == :push
if commits.length > 1 && compare if commits.length > 1 && compare
@notify.namespace_project_compare_url(project_namespace, @urls.namespace_project_compare_url(project_namespace,
project, project,
from: Commit.new(compare.base, project), from: Commit.new(compare.base, project),
to: Commit.new(compare.head, project)) to: Commit.new(compare.head, project))
else else
@notify.namespace_project_commit_url(project_namespace, @urls.namespace_project_commit_url(project_namespace,
project, commits.first) project, commits.first)
end end
else else
unless @action == :delete unless @action == :delete
@notify.namespace_project_tree_url(project_namespace, @urls.namespace_project_tree_url(project_namespace,
project, ref_name) project, ref_name)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment