BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e52e3ab5
Commit
e52e3ab5
authored
Nov 23, 2016
by
Gabriel Gizotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove whole description from #merge_commit_message and add add closed issues
parent
49a70d1e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
merge_request.rb
app/models/merge_request.rb
+2
-1
merge_request_spec.rb
spec/models/merge_request_spec.rb
+10
-4
No files found.
app/models/merge_request.rb
View file @
e52e3ab5
...
@@ -615,7 +615,8 @@ class MergeRequest < ActiveRecord::Base
...
@@ -615,7 +615,8 @@ class MergeRequest < ActiveRecord::Base
def
merge_commit_message
def
merge_commit_message
message
=
"Merge branch '
#{
source_branch
}
' into '
#{
target_branch
}
'
\n\n
"
message
=
"Merge branch '
#{
source_branch
}
' into '
#{
target_branch
}
'
\n\n
"
message
<<
"
#{
title
}
\n\n
"
message
<<
"
#{
title
}
\n\n
"
message
<<
"
#{
description
}
\n\n
"
if
description
.
present?
mr_closes_issues
=
closes_issues
message
<<
"Closed Issues:
#{
mr_closes_issues
.
map
{
|
issue
|
issue
.
to_reference
(
target_project
)
}
.join("
,
")}
\n\n
"
if
mr_closes_issues
.
present?
message
<<
"See merge request
#{
to_reference
}
"
message
<<
"See merge request
#{
to_reference
}
"
message
message
...
...
spec/models/merge_request_spec.rb
View file @
e52e3ab5
...
@@ -410,11 +410,17 @@ describe MergeRequest, models: true do
...
@@ -410,11 +410,17 @@ describe MergeRequest, models: true do
.
to
match
(
"Remove all technical debt
\n\n
"
)
.
to
match
(
"Remove all technical debt
\n\n
"
)
end
end
it
'includes its
description
in the body'
do
it
'includes its
closed issues
in the body'
do
request
=
build
(
:merge_request
,
description:
'By removing all code'
)
issue
=
create
(
:issue
,
project:
subject
.
project
)
expect
(
request
.
merge_commit_message
)
subject
.
project
.
team
<<
[
subject
.
author
,
:developer
]
.
to
match
(
"By removing all code
\n\n
"
)
subject
.
description
=
"Closes
#{
issue
.
to_reference
}
"
allow
(
subject
.
project
).
to
receive
(
:default_branch
).
and_return
(
subject
.
target_branch
)
expect
(
subject
.
merge_commit_message
)
.
to
match
(
"Closed Issues:
#{
issue
.
to_reference
}
"
)
end
end
it
'includes its reference in the body'
do
it
'includes its reference in the body'
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