Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
4b650fac
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4b650fac
编写于
2月 17, 2016
作者:
J
James Lopez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updated fix based on MR feedback
上级
dd68d100
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
4 addition
and
11 deletion
+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
未找到文件。
app/controllers/projects/forks_controller.rb
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录