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
Tatuya Kamada
gitlab-ce
Commits
fa54a8e9
Commit
fa54a8e9
authored
Aug 04, 2016
by
Paco Guzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don’t close issues on original project from a fork
Signed-off-by:
Paco Guzman
<
pacoguzmanp@gmail.com
>
parent
8890376f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
lib/gitlab/closing_issue_extractor.rb
lib/gitlab/closing_issue_extractor.rb
+3
-1
spec/lib/gitlab/closing_issue_extractor_spec.rb
spec/lib/gitlab/closing_issue_extractor_spec.rb
+11
-0
No files found.
lib/gitlab/closing_issue_extractor.rb
View file @
fa54a8e9
...
@@ -22,7 +22,9 @@ module Gitlab
...
@@ -22,7 +22,9 @@ module Gitlab
@extractor
.
analyze
(
closing_statements
.
join
(
" "
))
@extractor
.
analyze
(
closing_statements
.
join
(
" "
))
@extractor
.
issues
@extractor
.
issues
.
reject
do
|
issue
|
@extractor
.
project
.
forked_from?
(
issue
.
project
)
# Don't extract issues on original project
end
end
end
end
end
end
end
spec/lib/gitlab/closing_issue_extractor_spec.rb
View file @
fa54a8e9
...
@@ -3,10 +3,12 @@ require 'spec_helper'
...
@@ -3,10 +3,12 @@ require 'spec_helper'
describe
Gitlab
::
ClosingIssueExtractor
,
lib:
true
do
describe
Gitlab
::
ClosingIssueExtractor
,
lib:
true
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project2
)
{
create
(
:project
)
}
let
(
:project2
)
{
create
(
:project
)
}
let
(
:forked_project
)
{
Projects
::
ForkService
.
new
(
project
,
project
.
creator
).
execute
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:issue2
)
{
create
(
:issue
,
project:
project2
)
}
let
(
:issue2
)
{
create
(
:issue
,
project:
project2
)
}
let
(
:reference
)
{
issue
.
to_reference
}
let
(
:reference
)
{
issue
.
to_reference
}
let
(
:cross_reference
)
{
issue2
.
to_reference
(
project
)
}
let
(
:cross_reference
)
{
issue2
.
to_reference
(
project
)
}
let
(
:fork_cross_reference
)
{
issue
.
to_reference
(
forked_project
)
}
subject
{
described_class
.
new
(
project
,
project
.
creator
)
}
subject
{
described_class
.
new
(
project
,
project
.
creator
)
}
...
@@ -278,6 +280,15 @@ describe Gitlab::ClosingIssueExtractor, lib: true do
...
@@ -278,6 +280,15 @@ describe Gitlab::ClosingIssueExtractor, lib: true do
end
end
end
end
context
"with a cross-project fork reference"
do
subject
{
described_class
.
new
(
forked_project
,
forked_project
.
creator
)
}
it
do
message
=
"Closes
#{
fork_cross_reference
}
"
expect
(
subject
.
closed_by_message
(
message
)).
to
be_empty
end
end
context
"with an invalid URL"
do
context
"with an invalid URL"
do
it
do
it
do
message
=
"Closes https://google.com
#{
urls
.
namespace_project_issue_path
(
issue2
.
project
.
namespace
,
issue2
.
project
,
issue2
)
}
"
message
=
"Closes https://google.com
#{
urls
.
namespace_project_issue_path
(
issue2
.
project
.
namespace
,
issue2
.
project
,
issue2
)
}
"
...
...
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