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
Boxiang Sun
gitlab-ce
Commits
9b925d79
Commit
9b925d79
authored
Feb 04, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP - fix and spec for cross reference issue with forks
parent
e933a50b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
app/services/system_note_service.rb
app/services/system_note_service.rb
+2
-2
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+16
-0
No files found.
app/services/system_note_service.rb
View file @
9b925d79
...
@@ -291,8 +291,8 @@ class SystemNoteService
...
@@ -291,8 +291,8 @@ class SystemNoteService
notes
=
notes
.
where
(
noteable_id:
noteable
.
id
)
notes
=
notes
.
where
(
noteable_id:
noteable
.
id
)
end
end
gfm_reference
=
mentioner
.
gfm_reference
(
n
oteable
.
project
)
gfm_reference
=
mentioner
.
gfm_reference
(
n
il
)
notes
=
notes
.
where
(
note:
cross_reference_note_content
(
gfm_reference
)
)
notes
=
notes
.
where
(
'note LIKE ?'
,
"
#{
cross_reference_note_prefix
}
%
#{
gfm_reference
}
"
)
notes
.
count
>
0
notes
.
count
>
0
end
end
...
...
spec/services/system_note_service_spec.rb
View file @
9b925d79
...
@@ -424,6 +424,22 @@ describe SystemNoteService, services: true do
...
@@ -424,6 +424,22 @@ describe SystemNoteService, services: true do
to
be_falsey
to
be_falsey
end
end
end
end
context
'commit from fork'
do
let
(
:author2
)
{
create
(
:user
)
}
let
(
:forked_project
)
{
Projects
::
ForkService
.
new
(
project
,
author2
).
execute
}
let
(
:service
)
{
CreateCommitBuildsService
.
new
}
let
(
:commit2
)
{
forked_project
.
commit
}
before
do
described_class
.
cross_reference
(
commit0
,
commit2
,
author2
)
end
it
'is falsey when is a fork mentioning an external issue'
do
expect
(
described_class
.
cross_reference_exists?
(
commit0
,
commit2
)).
to
be_falsey
end
end
end
end
include
JiraServiceHelper
include
JiraServiceHelper
...
...
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