return nil for bad file version
This commit is contained in:
+7
-8
@@ -46,14 +46,13 @@ module Gollum
|
|||||||
#
|
#
|
||||||
# Returns a Gollum::File or nil if the file could not be found.
|
# Returns a Gollum::File or nil if the file could not be found.
|
||||||
def find(name, version)
|
def find(name, version)
|
||||||
commit = @wiki.repo.commit(version)
|
if commit = @wiki.repo.commit(version)
|
||||||
if blob = commit.tree / name
|
if blob = commit.tree / name
|
||||||
@blob = blob
|
@blob = blob
|
||||||
@path = name
|
@path = name
|
||||||
@version = commit
|
@version = commit
|
||||||
self
|
self
|
||||||
else
|
end
|
||||||
nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user