Commit 41f63acc authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix README detection for subdir

parent 5c67c887
......@@ -7,7 +7,8 @@ class Tree
@entries = Gitlab::Git::Tree.where(git_repo, sha, path)
if readme_tree = @entries.find(&:readme?)
@readme = Gitlab::Git::Blob.find(git_repo, sha, readme_tree.name)
readme_path = path == '/' ? readme_tree.name : File.join(path, readme_tree.name)
@readme = Gitlab::Git::Blob.find(git_repo, sha, readme_path)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment