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
iv
gitlab-ce
Commits
fb5ffa89
Commit
fb5ffa89
authored
Jun 16, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
parents
9af2bc89
903132bc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
CHANGELOG
CHANGELOG
+1
-0
app/services/system_note_service.rb
app/services/system_note_service.rb
+3
-1
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+9
-0
No files found.
CHANGELOG
View file @
fb5ffa89
...
...
@@ -9,6 +9,7 @@ v 7.13.0 (unreleased)
v 7.12.0 (unreleased)
- Fix post-receive errors on a push when an external issue tracker is configured (Stan Hu)
- Update oauth button logos for Twitter and Google to recommended assets
- Fix hooks for web based events with external issue references (Daniel Gerhardt)
- Update browser gem to version 0.8.0 for IE11 support (Stan Hu)
- Fix timeout when rendering file with thousands of lines.
- Add "Remember me" checkbox to LDAP signin form.
...
...
app/services/system_note_service.rb
View file @
fb5ffa89
...
...
@@ -212,13 +212,15 @@ class SystemNoteService
# Check if a cross-reference is disallowed
#
# This method prevents adding a "mentioned in !1" note on every single commit
# in a merge request.
# in a merge request. Additionally, it prevents the creation of references to
# external issues (which would fail).
#
# noteable - Noteable object being referenced
# mentioner - Mentionable object
#
# Returns Boolean
def
self
.
cross_reference_disallowed?
(
noteable
,
mentioner
)
return
true
if
noteable
.
is_a?
(
ExternalIssue
)
return
false
unless
mentioner
.
is_a?
(
MergeRequest
)
return
false
unless
noteable
.
is_a?
(
Commit
)
...
...
spec/services/system_note_service_spec.rb
View file @
fb5ffa89
...
...
@@ -338,6 +338,15 @@ describe SystemNoteService do
to
be_falsey
end
end
context
'when notable is an ExternalIssue'
do
let
(
:noteable
)
{
ExternalIssue
.
new
(
'EXT-1234'
,
project
)
}
it
'is truthy'
do
mentioner
=
noteable
.
dup
expect
(
described_class
.
cross_reference_disallowed?
(
noteable
,
mentioner
)).
to
be_truthy
end
end
end
describe
'.cross_reference_exists?'
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