BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d02d02c6
Commit
d02d02c6
authored
Oct 12, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error preventing displaying of commit data for a directory with a leading dot
Closes
https://github.com/gitlabhq/gitlabhq/issues/8763
parent
e12b6f30
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
2 deletions
+31
-2
CHANGELOG
CHANGELOG
+1
-0
refs_controller.rb
app/controllers/projects/refs_controller.rb
+7
-0
routes.rb
config/routes.rb
+3
-1
browse_files.feature
features/project/source/browse_files.feature
+6
-0
browse_files.rb
features/steps/project/source/browse_files.rb
+13
-0
test_env.rb
spec/support/test_env.rb
+1
-1
No files found.
CHANGELOG
View file @
d02d02c6
Please view this file on the master branch, on stable branches it's out of date.
Please view this file on the master branch, on stable branches it's out of date.
v 8.1.0 (unreleased)
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)
- Make diff file view easier to use on mobile screens (Stan Hu)
- Add support for creating directories from Files page (Stan Hu)
- Add support for creating directories from Files page (Stan Hu)
- Allow removing of project without confirmation when JavaScript is disabled (Stan Hu)
- Allow removing of project without confirmation when JavaScript is disabled (Stan Hu)
...
...
app/controllers/projects/refs_controller.rb
View file @
d02d02c6
...
@@ -3,6 +3,7 @@ class Projects::RefsController < Projects::ApplicationController
...
@@ -3,6 +3,7 @@ class Projects::RefsController < Projects::ApplicationController
include
TreeHelper
include
TreeHelper
before_action
:require_non_empty_project
before_action
:require_non_empty_project
before_action
:validate_ref_id
before_action
:assign_ref_vars
before_action
:assign_ref_vars
before_action
:authorize_download_code!
before_action
:authorize_download_code!
...
@@ -71,4 +72,10 @@ class Projects::RefsController < Projects::ApplicationController
...
@@ -71,4 +72,10 @@ class Projects::RefsController < Projects::ApplicationController
format
.
js
format
.
js
end
end
end
end
private
def
validate_ref_id
return
not_found!
if
params
[
:id
].
present?
&&
params
[
:id
]
!~
Gitlab
::
Regex
.
git_reference_regex
end
end
end
config/routes.rb
View file @
d02d02c6
...
@@ -543,8 +543,10 @@ Gitlab::Application.routes.draw do
...
@@ -543,8 +543,10 @@ Gitlab::Application.routes.draw do
member
do
member
do
# tree viewer logs
# tree viewer logs
get
'logs_tree'
,
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
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:
{
get
'logs_tree/*path'
=>
'refs#logs_tree'
,
as: :logs_file
,
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
,
id:
/.*/
,
path:
/.*/
path:
/.*/
}
}
end
end
...
...
features/project/source/browse_files.feature
View file @
d02d02c6
...
@@ -205,3 +205,9 @@ Feature: Project Source Browse Files
...
@@ -205,3 +205,9 @@ Feature: Project Source Browse Files
And
I see the ref 'test' has been selected
And
I see the ref 'test' has been selected
And
I visit the 'test' tree
And
I visit the 'test' tree
Then
I see the commit data
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
View file @
d02d02c6
...
@@ -286,6 +286,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -286,6 +286,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
select
"'test'"
,
from:
'ref'
select
"'test'"
,
from:
'ref'
end
end
step
"I switch ref to fix"
do
select
"fix"
,
from:
'ref'
end
step
"I see the ref 'test' has been selected"
do
step
"I see the ref 'test' has been selected"
do
expect
(
page
).
to
have_selector
'.select2-chosen'
,
text:
"'test'"
expect
(
page
).
to
have_selector
'.select2-chosen'
,
text:
"'test'"
end
end
...
@@ -294,11 +298,20 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -294,11 +298,20 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
visit
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"'test'"
)
visit
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"'test'"
)
end
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
step
'I see the commit data'
do
expect
(
page
).
to
have_css
(
'.tree-commit-link'
,
visible:
true
)
expect
(
page
).
to
have_css
(
'.tree-commit-link'
,
visible:
true
)
expect
(
page
).
not_to
have_content
(
'Loading commit data...'
)
expect
(
page
).
not_to
have_content
(
'Loading commit data...'
)
end
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
private
def
set_new_content
def
set_new_content
...
...
spec/support/test_env.rb
View file @
d02d02c6
...
@@ -9,7 +9,7 @@ module TestEnv
...
@@ -9,7 +9,7 @@ module TestEnv
'flatten-dir'
=>
'e56497b'
,
'flatten-dir'
=>
'e56497b'
,
'feature'
=>
'0b4bc9a'
,
'feature'
=>
'0b4bc9a'
,
'feature_conflict'
=>
'bb5206f'
,
'feature_conflict'
=>
'bb5206f'
,
'fix'
=>
'
12d65c8
'
,
'fix'
=>
'
48f0be4
'
,
'improve/awesome'
=>
'5937ac0'
,
'improve/awesome'
=>
'5937ac0'
,
'markdown'
=>
'0ed8c6c'
,
'markdown'
=>
'0ed8c6c'
,
'master'
=>
'5937ac0'
,
'master'
=>
'5937ac0'
,
...
...
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