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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
2d8d94a7
Commit
2d8d94a7
authored
Aug 30, 2016
by
Katarzyna Kobierska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change method name
parent
72266311
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
14 deletions
+8
-14
CHANGELOG
CHANGELOG
+1
-7
app/models/merge_request.rb
app/models/merge_request.rb
+3
-3
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+4
-4
No files found.
CHANGELOG
View file @
2d8d94a7
...
...
@@ -40,6 +40,7 @@ v 8.12.0 (unreleased)
- Use the default branch for displaying the project icon instead of master !5792 (Hannes Rosenögger)
- Adds response mime type to transaction metric action when it's not HTML
- Fix hover leading space bug in pipeline graph !5980
- User can edit closed MR with deleted fork (Katarzyna Kobierska Ula Budziszewska) !5496
v 8.11.3 (unreleased)
- Allow system info page to handle case where info is unavailable
...
...
@@ -53,13 +54,6 @@ v 8.11.2
- Show "Create Merge Request" widget for push events to fork projects on the source project. !5978
- Use gitlab-workhorse 0.7.11 !5983
- Does not halt the GitHub import process when an error occurs. !5763
- User can edit closed MR with deleted fork (Katarzyna Kobierska Ula Budziszewska) !5496
v 8.11.2 (unreleased)
- Show "Create Merge Request" widget for push events to fork projects on the source project
v 8.11.1 (unreleased)
- Does not halt the GitHub import process when an error occurs
- Fix file links on project page when default view is Files !5933
- Fixed enter key in search input not working !5888
...
...
app/models/merge_request.rb
View file @
2d8d94a7
...
...
@@ -306,17 +306,17 @@ class MergeRequest < ActiveRecord::Base
def
validate_fork
return
true
unless
target_project
&&
source_project
return
true
if
target_project
==
source_project
return
true
unless
fork_missing?
return
true
unless
fork
ed_source_project
_missing?
errors
.
add
:validate_fork
,
'Source project is not a fork of the target project'
end
def
closed_without_fork?
closed?
&&
fork_missing?
closed?
&&
fork
ed_source_project
_missing?
end
def
fork_missing?
def
fork
ed_source_project
_missing?
return
false
unless
for_fork?
return
true
unless
source_project
...
...
spec/models/merge_request_spec.rb
View file @
2d8d94a7
...
...
@@ -963,7 +963,7 @@ describe MergeRequest, models: true do
end
end
describe
"#fork_missing?"
do
describe
"#fork
ed_source_project
_missing?"
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
)
}
let
(
:user
)
{
create
(
:user
)
}
...
...
@@ -976,13 +976,13 @@ describe MergeRequest, models: true do
target_project:
project
)
end
it
{
expect
(
merge_request
.
fork_missing?
).
to
be_falsey
}
it
{
expect
(
merge_request
.
fork
ed_source_project
_missing?
).
to
be_falsey
}
end
context
"when the source project is the same as the target project"
do
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
it
{
expect
(
merge_request
.
fork_missing?
).
to
be_falsey
}
it
{
expect
(
merge_request
.
fork
ed_source_project
_missing?
).
to
be_falsey
}
end
context
"when the fork does not exist"
do
...
...
@@ -996,7 +996,7 @@ describe MergeRequest, models: true do
unlink_project
.
execute
merge_request
.
reload
expect
(
merge_request
.
fork_missing?
).
to
be_truthy
expect
(
merge_request
.
fork
ed_source_project
_missing?
).
to
be_truthy
end
end
end
...
...
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