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
0fd9ceb5
Commit
0fd9ceb5
authored
Sep 23, 2019
by
Jesse Hall
Committed by
Stan Hu
Sep 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #32595, users can view the blame or history of file with newlines in its filename.
parent
30bbab28
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
changelogs/unreleased/32595-blame-or-history-newline-in-filename.yml
...unreleased/32595-blame-or-history-newline-in-filename.yml
+5
-0
config/routes/repository.rb
config/routes/repository.rb
+1
-1
spec/routing/project_routing_spec.rb
spec/routing/project_routing_spec.rb
+5
-0
No files found.
changelogs/unreleased/32595-blame-or-history-newline-in-filename.yml
0 → 100644
View file @
0fd9ceb5
---
title
:
Users can view the blame or history of a file with newlines in its filename.
merge_request
:
17543
author
:
Jesse Hall @jessehall3
type
:
fixed
config/routes/repository.rb
View file @
0fd9ceb5
...
@@ -34,7 +34,7 @@ scope format: false do
...
@@ -34,7 +34,7 @@ scope format: false do
# ref regex used in constraints. Regex verification now done in controller.
# ref regex used in constraints. Regex verification now done in controller.
get
'logs_tree/*path'
,
action: :logs_tree
,
as: :logs_file
,
format:
false
,
constraints:
{
get
'logs_tree/*path'
,
action: :logs_tree
,
as: :logs_file
,
format:
false
,
constraints:
{
id:
/.*/
,
id:
/.*/
,
path:
/
.
*/
path:
/
[^\0]
*/
}
}
end
end
end
end
...
...
spec/routing/project_routing_spec.rb
View file @
0fd9ceb5
...
@@ -276,6 +276,11 @@ describe 'project routing' do
...
@@ -276,6 +276,11 @@ describe 'project routing' do
expect
(
get
(
'/gitlab/gitlabhq/refs/feature%2B45/logs_tree/foo/bar/baz'
)).
to
route_to
(
'projects/refs#logs_tree'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'feature+45'
,
path:
'foo/bar/baz'
)
expect
(
get
(
'/gitlab/gitlabhq/refs/feature%2B45/logs_tree/foo/bar/baz'
)).
to
route_to
(
'projects/refs#logs_tree'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'feature+45'
,
path:
'foo/bar/baz'
)
expect
(
get
(
'/gitlab/gitlabhq/refs/feature@45/logs_tree/foo/bar/baz'
)).
to
route_to
(
'projects/refs#logs_tree'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'feature@45'
,
path:
'foo/bar/baz'
)
expect
(
get
(
'/gitlab/gitlabhq/refs/feature@45/logs_tree/foo/bar/baz'
)).
to
route_to
(
'projects/refs#logs_tree'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'feature@45'
,
path:
'foo/bar/baz'
)
expect
(
get
(
'/gitlab/gitlabhq/refs/stable/logs_tree/files.scss'
)).
to
route_to
(
'projects/refs#logs_tree'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'stable'
,
path:
'files.scss'
)
expect
(
get
(
'/gitlab/gitlabhq/refs/stable/logs_tree/files.scss'
)).
to
route_to
(
'projects/refs#logs_tree'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
'stable'
,
path:
'files.scss'
)
assert_routing
({
path:
"/gitlab/gitlabhq/refs/stable/logs_tree/new%0A%0Aline.txt"
,
method: :get
},
{
controller:
'projects/refs'
,
action:
'logs_tree'
,
namespace_id:
'gitlab'
,
project_id:
'gitlabhq'
,
id:
"stable"
,
path:
"new
\n\n
line.txt"
})
end
end
end
end
...
...
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