Wiki#tree_map_for returns an array of BlobEntry instances

This commit is contained in:
rick
2010-08-30 17:30:45 -07:00
parent 6f077702e1
commit 7e2b1fdbc6
6 changed files with 69 additions and 37 deletions
+2 -2
View File
@@ -49,9 +49,9 @@ module Gollum
checked = name.downcase
map = @wiki.tree_map_for(version)
sha = @wiki.ref_map[version] || version
if pair = map.detect { |(path, _)| path.downcase == checked }
if entry = map.detect { |entry| entry.path.downcase == checked }
@path = name
@blob = Grit::Blob.create(@wiki.repo, :id => pair.last, :name => ::File.basename(@path))
@blob = Grit::Blob.create(@wiki.repo, :id => entry.sha, :name => entry.name)
@version = Grit::Commit.create(@wiki.repo, :id => sha)
self
end