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
Boxiang Sun
gitlab-ce
Commits
09d323de
Commit
09d323de
authored
Sep 07, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a "Wrong number of arguments" error in TreeHelper#flatten_tree
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
4ae8e20c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
app/helpers/tree_helper.rb
app/helpers/tree_helper.rb
+1
-1
spec/features/projects/user_browses_a_tree_with_a_folder_containing_only_a_folder.rb
..._browses_a_tree_with_a_folder_containing_only_a_folder.rb
+20
-0
No files found.
app/helpers/tree_helper.rb
View file @
09d323de
...
...
@@ -104,7 +104,7 @@ module TreeHelper
subtree
=
Gitlab
::
Git
::
Tree
.
where
(
@repository
,
@commit
.
id
,
tree
.
path
)
if
subtree
.
count
==
1
&&
subtree
.
first
.
dir?
return
tree_join
(
tree
.
name
,
flatten_tree
(
subtree
.
first
))
return
tree_join
(
tree
.
name
,
flatten_tree
(
root_path
,
subtree
.
first
))
else
return
tree
.
name
end
...
...
spec/features/projects/user_browses_a_tree_with_a_folder_containing_only_a_folder.rb
0 → 100644
View file @
09d323de
require
'spec_helper'
# This is a regression test for https://gitlab.com/gitlab-org/gitlab-ce/issues/37569
describe
'User browses a tree with a folder containing only a folder'
do
let
(
:project
)
{
create
(
:project
,
:empty_repo
)
}
let
(
:user
)
{
project
.
creator
}
before
do
# We need to disable the tree.flat_path provided by Gitaly to reproduce the issue
allow
(
Gitlab
::
GitalyClient
).
to
receive
(
:feature_enabled?
).
and_return
(
false
)
project
.
repository
.
create_dir
(
user
,
'foo/bar'
,
branch_name:
'master'
,
message:
'Add the foo/bar folder'
)
sign_in
(
user
)
visit
(
project_tree_path
(
project
,
project
.
repository
.
root_ref
))
end
it
'shows the nested folder on a single row'
do
expect
(
page
).
to
have_content
(
'foo/bar'
)
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