Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cbeb06eb
Commit
cbeb06eb
authored
Dec 11, 2015
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mix url helpers in into `RepositoryPush`
parent
6ffe8a06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
lib/gitlab/email/message/repository_push.rb
lib/gitlab/email/message/repository_push.rb
+10
-9
No files found.
lib/gitlab/email/message/repository_push.rb
View file @
cbeb06eb
...
@@ -5,6 +5,8 @@ module Gitlab
...
@@ -5,6 +5,8 @@ module Gitlab
attr_accessor
:recipient
attr_accessor
:recipient
attr_reader
:author_id
,
:ref
,
:action
attr_reader
:author_id
,
:ref
,
:action
include
Gitlab
::
Application
.
routes
.
url_helpers
delegate
:namespace
,
:name_with_namespace
,
to: :project
,
prefix: :project
delegate
:namespace
,
:name_with_namespace
,
to: :project
,
prefix: :project
delegate
:name
,
to: :author
,
prefix: :author
delegate
:name
,
to: :author
,
prefix: :author
...
@@ -16,7 +18,6 @@ module Gitlab
...
@@ -16,7 +18,6 @@ module Gitlab
@project_id
=
project_id
@project_id
=
project_id
@recipient
=
recipient
@recipient
=
recipient
@opts
=
opts
.
dup
@opts
=
opts
.
dup
@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
)
...
@@ -86,18 +87,18 @@ module Gitlab
...
@@ -86,18 +87,18 @@ module Gitlab
def
target_url
def
target_url
if
@action
==
:push
&&
commits
if
@action
==
:push
&&
commits
if
commits
.
length
>
1
if
commits
.
length
>
1
@urls
.
namespace_project_compare_url
(
project_namespace
,
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
@urls
.
namespace_project_commit_url
(
project_namespace
,
namespace_project_commit_url
(
project_namespace
,
project
,
commits
.
first
)
project
,
commits
.
first
)
end
end
else
else
unless
@action
==
:delete
unless
@action
==
:delete
@urls
.
namespace_project_tree_url
(
project_namespace
,
namespace_project_tree_url
(
project_namespace
,
project
,
ref_name
)
project
,
ref_name
)
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment