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
Jérome Perrin
gitlab-ce
Commits
4b650fac
Commit
4b650fac
authored
Feb 17, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated fix based on MR feedback
parent
dd68d100
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
11 deletions
+4
-11
app/controllers/projects/forks_controller.rb
app/controllers/projects/forks_controller.rb
+1
-3
app/views/projects/forks/index.html.haml
app/views/projects/forks/index.html.haml
+1
-1
app/views/shared/projects/_project.html.haml
app/views/shared/projects/_project.html.haml
+1
-1
features/project/fork.feature
features/project/fork.feature
+1
-1
features/steps/project/fork.rb
features/steps/project/fork.rb
+0
-5
No files found.
app/controllers/projects/forks_controller.rb
View file @
4b650fac
...
...
@@ -5,9 +5,7 @@ class Projects::ForksController < Projects::ApplicationController
def
index
@sort
=
params
[
:sort
]
||
'id_desc'
@all_forks
=
project
.
forks
.
includes
(
:creator
).
order_by
(
@sort
).
reject
do
|
project
|
project
.
repository
.
raw_repository
.
nil?
end
@all_forks
=
project
.
forks
.
includes
(
:creator
).
order_by
(
@sort
)
@public_forks
,
@protected_forks
=
@all_forks
.
partition
do
|
project
|
can?
(
current_user
,
:read_project
,
project
)
...
...
app/views/projects/forks/index.html.haml
View file @
4b650fac
...
...
@@ -30,7 +30,7 @@
=
sort_title_oldest_updated
-
if
current_user
&&
can?
(
current_user
,
:fork_project
,
@project
)
-
if
current_user
.
already_forked?
(
@project
)
&&
current_user
.
manageable_namespaces
.
size
<
2
-
if
current_user
&&
current_user
.
already_forked?
(
@project
)
&&
current_user
.
manageable_namespaces
.
size
<
2
=
link_to
namespace_project_path
(
current_user
,
current_user
.
fork_of
(
@project
)),
title:
'Go to your fork'
,
class:
'btn btn-new'
do
=
icon
(
'code-fork fw'
)
Fork
...
...
app/views/shared/projects/_project.html.haml
View file @
4b650fac
...
...
@@ -4,7 +4,7 @@
-
ci
=
false
unless
local_assigns
[
:ci
]
==
true
-
skip_namespace
=
false
unless
local_assigns
[
:skip_namespace
]
==
true
-
css_class
=
''
unless
local_assigns
[
:css_class
]
-
show_last_commit_as_description
=
false
unless
local_assigns
[
:show_last_commit_as_description
]
==
true
-
show_last_commit_as_description
=
false
unless
local_assigns
[
:show_last_commit_as_description
]
==
true
&&
!
project
.
empty_repo?
&&
project
.
commit
-
css_class
+=
" no-description"
if
project
.
description
.
blank?
&&
!
show_last_commit_as_description
-
ci_commit
=
project
.
ci_commit
(
project
.
commit
.
sha
)
if
ci
&&
!
project
.
empty_repo?
&&
project
.
commit
-
cache_key
=
[
project
.
namespace
,
project
,
controller
.
controller_name
,
controller
.
action_name
,
current_application_settings
,
'v2.2'
]
...
...
features/project/fork.feature
View file @
4b650fac
...
...
@@ -37,7 +37,7 @@ Feature: Project 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
Then
I should
see my fork on the list
Scenario
:
Viewing private forks of a Project
Given
There is an existent fork of the
"Shop"
project
...
...
features/steps/project/fork.rb
View file @
4b650fac
...
...
@@ -68,11 +68,6 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
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