can't access trees as files
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user