Skip to content
Snippets Groups Projects
Verified Commit 09d323de authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Fix a "Wrong number of arguments" error in TreeHelper#flatten_tree


Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 4ae8e20c
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment