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
b1731adf
Commit
b1731adf
authored
Feb 16, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround for forks with an invalid repo - avoid showing them in the list
parent
3de6edd6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
app/controllers/projects/forks_controller.rb
app/controllers/projects/forks_controller.rb
+3
-1
features/project/fork.feature
features/project/fork.feature
+7
-0
features/steps/project/fork.rb
features/steps/project/fork.rb
+11
-0
No files found.
app/controllers/projects/forks_controller.rb
View file @
b1731adf
...
...
@@ -5,7 +5,9 @@ class Projects::ForksController < Projects::ApplicationController
def
index
@sort
=
params
[
:sort
]
||
'id_desc'
@all_forks
=
project
.
forks
.
includes
(
:creator
).
order_by
(
@sort
)
@all_forks
=
project
.
forks
.
includes
(
:creator
).
order_by
(
@sort
).
reject
do
|
project
|
project
.
repository
.
raw_repository
.
nil?
end
@public_forks
,
@protected_forks
=
@all_forks
.
partition
do
|
project
|
can?
(
current_user
,
:read_project
,
project
)
...
...
features/project/fork.feature
View file @
b1731adf
...
...
@@ -32,6 +32,13 @@ Feature: Project Fork
And
I visit the forks page of the
"Shop"
project
Then
I should see my fork on the list
Scenario
:
Viewing forks of a Project that has no repo
Given
I click link
"Fork"
When
I fork to my namespace
And
I make forked repo invalid
And
I visit the forks page of the
"Shop"
project
Then
I should not see the invalid fork listed
Scenario
:
Viewing private forks of a Project
Given
There is an existent fork of the
"Shop"
project
And
I click link
"Fork"
...
...
features/steps/project/fork.rb
View file @
b1731adf
...
...
@@ -62,6 +62,17 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
end
end
step
'I make forked repo invalid'
do
project
=
@user
.
fork_of
(
@project
)
project
.
path
=
'test-crappy-path'
project
.
save!
end
step
'I should not see the invalid fork listed'
do
project
=
@user
.
fork_of
(
@project
)
expect
(
page
).
not_to
have_content
(
"
#{
project
.
namespace
.
human_name
}
/
#{
project
.
name
}
"
)
end
step
'There is an existent fork of the "Shop" project'
do
user
=
create
(
:user
,
name:
'Mike'
)
@forked_project
=
Projects
::
ForkService
.
new
(
@project
,
user
).
execute
...
...
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