Commit 41f63acc84ac0f8f348c8393f4094b2aa597461c
1 parent
5c67c887
Exists in
master
and in
4 other branches
Fix README detection for subdir
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
app/models/tree.rb
... | ... | @@ -7,7 +7,8 @@ class Tree |
7 | 7 | @entries = Gitlab::Git::Tree.where(git_repo, sha, path) |
8 | 8 | |
9 | 9 | if readme_tree = @entries.find(&:readme?) |
10 | - @readme = Gitlab::Git::Blob.find(git_repo, sha, readme_tree.name) | |
10 | + readme_path = path == '/' ? readme_tree.name : File.join(path, readme_tree.name) | |
11 | + @readme = Gitlab::Git::Blob.find(git_repo, sha, readme_path) | |
11 | 12 | end |
12 | 13 | end |
13 | 14 | ... | ... |