Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
a5f72a6a25fb
Commit
02c46bfc
authored
Jan 22, 2018
by
Mike Greiling
Browse files
ensure fork_source returns nil when project is the root fork, add tests
parent
27f8a4ddb2f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
a5f72a6a
...
...
@@ -1032,6 +1032,8 @@ def forked?
end
def
fork_source
return
nil
unless
forked?
forked_from_project
||
fork_network
&
.
root_project
end
...
...
spec/models/project_spec.rb
View file @
a5f72a6a
...
...
@@ -1951,6 +1951,10 @@ def create_build(new_pipeline = pipeline, name = 'test')
expect
(
second_fork
.
fork_source
).
to
eq
(
project
)
end
it
'returns nil if it is the root of the fork network'
do
expect
(
project
.
fork_source
).
to
be_nil
end
end
describe
'#lfs_storage_project'
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