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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
607f0c05
Commit
607f0c05
authored
Feb 20, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change EmailsOnPush subject to include namespace, repo and branch.
See #1827.
parent
a30a5663
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
app/mailers/emails/projects.rb
app/mailers/emails/projects.rb
+6
-3
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+1
-1
No files found.
app/mailers/emails/projects.rb
View file @
607f0c05
...
@@ -23,21 +23,24 @@ module Emails
...
@@ -23,21 +23,24 @@ module Emails
@commits
=
Commit
.
decorate
(
compare
.
commits
)
@commits
=
Commit
.
decorate
(
compare
.
commits
)
@diffs
=
compare
.
diffs
@diffs
=
compare
.
diffs
@branch
=
branch
@branch
=
branch
@subject
=
"[
#{
@project
.
path_with_namespace
}
][
#{
@branch
}
] "
if
@commits
.
length
>
1
if
@commits
.
length
>
1
@target_url
=
namespace_project_compare_url
(
@project
.
namespace
,
@target_url
=
namespace_project_compare_url
(
@project
.
namespace
,
@project
,
@project
,
from:
@commits
.
first
,
from:
@commits
.
first
,
to:
@commits
.
last
)
to:
@commits
.
last
)
@subject
=
"
#{
@commits
.
length
}
new commits pushed to repository
"
@subject
<<
"
#{
@commits
.
length
}
commits:
#{
@commits
.
first
.
title
}
"
else
else
@target_url
=
namespace_project_commit_url
(
@project
.
namespace
,
@target_url
=
namespace_project_commit_url
(
@project
.
namespace
,
@project
,
@commits
.
first
)
@project
,
@commits
.
first
)
@subject
=
@commits
.
first
.
title
@subject
<<
@commits
.
first
.
title
end
end
mail
(
from:
sender
(
author_id
),
mail
(
from:
sender
(
author_id
),
to:
recipient
,
to:
recipient
,
subject:
subject
(
@subject
)
)
subject:
@subject
)
end
end
end
end
end
end
spec/mailers/notify_spec.rb
View file @
607f0c05
...
@@ -583,7 +583,7 @@ describe Notify do
...
@@ -583,7 +583,7 @@ describe Notify do
end
end
it
'has the correct subject'
do
it
'has the correct subject'
do
is_expected
.
to
have_subject
/
#{
commits
.
length
}
new commits pushed to repository
/
is_expected
.
to
have_subject
/
\[
#{
project
.
path_with_namespace
}
\]\[master\]
#{
commits
.
length
}
commits:
/
end
end
it
'includes commits list'
do
it
'includes commits list'
do
...
...
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