can't access trees as files

This commit is contained in:
rick
2010-08-16 14:57:39 -07:00
parent c69a5f80dd
commit c7e172f5ca
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ module Gollum
# Returns a Gollum::File or nil if the file could not be found.
def find(name, version)
if commit = @wiki.repo.commit(version)
if blob = commit.tree / name
if (blob = commit.tree / name) && blob.is_a?(Grit::Blob)
@blob = blob
@path = name
@version = commit
+4
View File
@@ -15,4 +15,8 @@ context "File" do
assert_equal "[ ] Write section on Ents\n", file.raw_data
assert_equal @wiki.repo.commits.first.id, file.version.id
end
test "accessing tree" do
assert_nil @wiki.file("Mordor")
end
end