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
0e76daf3
Commit
0e76daf3
authored
Nov 25, 2016
by
Gabriel Gizotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only look for issues mentioned on description on MergeRequest#issues_mentioned_but_not_closing
parent
c1515cd8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
app/models/merge_request.rb
app/models/merge_request.rb
+4
-2
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+1
-1
No files found.
app/models/merge_request.rb
View file @
0e76daf3
...
@@ -570,18 +570,20 @@ class MergeRequest < ActiveRecord::Base
...
@@ -570,18 +570,20 @@ class MergeRequest < ActiveRecord::Base
def
issues_mentioned_but_not_closing
(
current_user
=
self
.
author
)
def
issues_mentioned_but_not_closing
(
current_user
=
self
.
author
)
issues
=
[]
issues
=
[]
closing_issues
=
[]
if
target_branch
==
project
.
default_branch
if
target_branch
==
project
.
default_branch
messages
=
[
description
]
messages
=
[
description
]
messages
.
concat
(
commits
.
map
(
&
:safe_message
))
if
merge_request_diff
ext
=
Gitlab
::
ReferenceExtractor
.
new
(
project
,
current_user
)
ext
=
Gitlab
::
ReferenceExtractor
.
new
(
project
,
current_user
)
ext
.
analyze
(
messages
.
join
(
"
\n
"
))
ext
.
analyze
(
messages
.
join
(
"
\n
"
))
issues
=
ext
.
issues
issues
=
ext
.
issues
closing_issues
=
Gitlab
::
ClosingIssueExtractor
.
new
(
project
,
current_user
).
closed_by_message
(
messages
.
join
(
"
\n
"
))
end
end
issues
-
clos
es
_issues
issues
-
clos
ing
_issues
end
end
def
target_project_path
def
target_project_path
...
...
spec/models/merge_request_spec.rb
View file @
0e76daf3
...
@@ -294,7 +294,7 @@ describe MergeRequest, models: true do
...
@@ -294,7 +294,7 @@ describe MergeRequest, models: true do
end
end
end
end
it
'detects issues mentioned but not closed'
do
it
'detects issues mentioned
in description
but not closed'
do
mentioned_issue
=
create
(
:issue
,
project:
subject
.
project
)
mentioned_issue
=
create
(
:issue
,
project:
subject
.
project
)
subject
.
description
=
"Is related to
#{
mentioned_issue
.
to_reference
}
"
subject
.
description
=
"Is related to
#{
mentioned_issue
.
to_reference
}
"
...
...
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