summaryrefslogtreecommitdiff
path: root/app/models/tree.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-10-13 16:03:16 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-10-13 16:03:16 +0300
commit41f63acc84ac0f8f348c8393f4094b2aa597461c (patch)
tree7fb456db27a8e13047fe2758ce3010a56dd08e4f /app/models/tree.rb
parent5c67c88731b4e53325a5c6efdcc36f08d405bbdb (diff)
downloadgitlab-ce-41f63acc84ac0f8f348c8393f4094b2aa597461c.tar.gz
Fix README detection for subdir
Diffstat (limited to 'app/models/tree.rb')
-rw-r--r--app/models/tree.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/tree.rb b/app/models/tree.rb
index 5fbad19b468..ed06cb1a128 100644
--- a/app/models/tree.rb
+++ b/app/models/tree.rb
@@ -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