Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
d02d02c6
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 搜索 >>
提交
d02d02c6
编写于
10月 12, 2015
作者:
S
Stan Hu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix error preventing displaying of commit data for a directory with a leading dot
Closes
https://github.com/gitlabhq/gitlabhq/issues/8763
上级
e12b6f30
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
31 addition
and
2 deletion
+31
-2
CHANGELOG
CHANGELOG
+1
-0
app/controllers/projects/refs_controller.rb
app/controllers/projects/refs_controller.rb
+7
-0
config/routes.rb
config/routes.rb
+3
-1
features/project/source/browse_files.feature
features/project/source/browse_files.feature
+6
-0
features/steps/project/source/browse_files.rb
features/steps/project/source/browse_files.rb
+13
-0
spec/support/test_env.rb
spec/support/test_env.rb
+1
-1
未找到文件。
CHANGELOG
浏览文件 @
d02d02c6
Please view this file on the master branch, on stable branches it's out of date.
v 8.1.0 (unreleased)
- Fix error preventing displaying of commit data for a directory with a leading dot (Stan Hu)
- Make diff file view easier to use on mobile screens (Stan Hu)
- Add support for creating directories from Files page (Stan Hu)
- Allow removing of project without confirmation when JavaScript is disabled (Stan Hu)
...
...
app/controllers/projects/refs_controller.rb
浏览文件 @
d02d02c6
...
...
@@ -3,6 +3,7 @@ class Projects::RefsController < Projects::ApplicationController
include
TreeHelper
before_action
:require_non_empty_project
before_action
:validate_ref_id
before_action
:assign_ref_vars
before_action
:authorize_download_code!
...
...
@@ -71,4 +72,10 @@ class Projects::RefsController < Projects::ApplicationController
format
.
js
end
end
private
def
validate_ref_id
return
not_found!
if
params
[
:id
].
present?
&&
params
[
:id
]
!~
Gitlab
::
Regex
.
git_reference_regex
end
end
config/routes.rb
浏览文件 @
d02d02c6
...
...
@@ -543,8 +543,10 @@ Gitlab::Application.routes.draw do
member
do
# tree viewer logs
get
'logs_tree'
,
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
# Directories with leading dots erroneously get rejected if git
# ref regex used in constraints. Regex verification now done in controller.
get
'logs_tree/*path'
=>
'refs#logs_tree'
,
as: :logs_file
,
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
,
id:
/.*/
,
path:
/.*/
}
end
...
...
features/project/source/browse_files.feature
浏览文件 @
d02d02c6
...
...
@@ -205,3 +205,9 @@ Feature: Project Source Browse Files
And
I see the ref 'test' has been selected
And
I visit the 'test' tree
Then
I see the commit data
@javascript
Scenario
:
I
browse code with a leading dot in the directory
Given
I switch ref to fix
And
I visit the fix tree
Then
I see the commit data for a directory with a leading dot
features/steps/project/source/browse_files.rb
浏览文件 @
d02d02c6
...
...
@@ -286,6 +286,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
select
"'test'"
,
from:
'ref'
end
step
"I switch ref to fix"
do
select
"fix"
,
from:
'ref'
end
step
"I see the ref 'test' has been selected"
do
expect
(
page
).
to
have_selector
'.select2-chosen'
,
text:
"'test'"
end
...
...
@@ -294,11 +298,20 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
visit
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"'test'"
)
end
step
"I visit the fix tree"
do
visit
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"fix/.testdir"
)
end
step
'I see the commit data'
do
expect
(
page
).
to
have_css
(
'.tree-commit-link'
,
visible:
true
)
expect
(
page
).
not_to
have_content
(
'Loading commit data...'
)
end
step
'I see the commit data for a directory with a leading dot'
do
expect
(
page
).
to
have_css
(
'.tree-commit-link'
,
visible:
true
)
expect
(
page
).
not_to
have_content
(
'Loading commit data...'
)
end
private
def
set_new_content
...
...
spec/support/test_env.rb
浏览文件 @
d02d02c6
...
...
@@ -9,7 +9,7 @@ module TestEnv
'flatten-dir'
=>
'e56497b'
,
'feature'
=>
'0b4bc9a'
,
'feature_conflict'
=>
'bb5206f'
,
'fix'
=>
'
12d65c8
'
,
'fix'
=>
'
48f0be4
'
,
'improve/awesome'
=>
'5937ac0'
,
'markdown'
=>
'0ed8c6c'
,
'master'
=>
'5937ac0'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录