Fix README detection for subdir

This commit is contained in:
Dmitriy Zaporozhets 2013-10-13 16:03:16 +03:00
parent 5c67c88731
commit 41f63acc84
1 changed files with 2 additions and 1 deletions

View File

@ -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