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
cb1f3423
Commit
cb1f3423
authored
Jul 03, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't resolve fork relationships for projects pending delete
parent
1501a4f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
app/models/forked_project_link.rb
app/models/forked_project_link.rb
+2
-2
spec/models/forked_project_link_spec.rb
spec/models/forked_project_link_spec.rb
+16
-0
No files found.
app/models/forked_project_link.rb
View file @
cb1f3423
class
ForkedProjectLink
<
ActiveRecord
::
Base
class
ForkedProjectLink
<
ActiveRecord
::
Base
belongs_to
:forked_to_project
,
class_name:
'Project'
belongs_to
:forked_to_project
,
->
{
where
.
not
(
pending_delete:
true
)
},
class_name:
'Project'
belongs_to
:forked_from_project
,
class_name:
'Project'
belongs_to
:forked_from_project
,
->
{
where
.
not
(
pending_delete:
true
)
},
class_name:
'Project'
end
end
spec/models/forked_project_link_spec.rb
View file @
cb1f3423
...
@@ -24,6 +24,22 @@ describe ForkedProjectLink, "add link on fork" do
...
@@ -24,6 +24,22 @@ describe ForkedProjectLink, "add link on fork" do
expect
(
project_to
.
forked_from_project
).
to
eq
(
project_from
)
expect
(
project_to
.
forked_from_project
).
to
eq
(
project_from
)
end
end
context
'project_to is pending_delete'
do
before
do
project_to
.
update!
(
pending_delete:
true
)
end
it
{
expect
(
project_from
.
forks
.
count
).
to
eq
(
0
)
}
end
context
'project_from is pending_delete'
do
before
do
project_from
.
update!
(
pending_delete:
true
)
end
it
{
expect
(
project_to
.
forked_from_project
).
to
be_nil
}
end
describe
'#forked?'
do
describe
'#forked?'
do
let
(
:project_to
)
{
create
(
:project
,
forked_project_link:
forked_project_link
)
}
let
(
:project_to
)
{
create
(
:project
,
forked_project_link:
forked_project_link
)
}
let
(
:forked_project_link
)
{
build
(
:forked_project_link
)
}
let
(
:forked_project_link
)
{
build
(
:forked_project_link
)
}
...
...
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