return nil for bad file version

This commit is contained in:
rick
2010-08-13 16:10:59 -07:00
parent 2a905cedc9
commit edcfdfa402
+7 -8
View File
@@ -46,14 +46,13 @@ module Gollum
#
# Returns a Gollum::File or nil if the file could not be found.
def find(name, version)
commit = @wiki.repo.commit(version)
if blob = commit.tree / name
@blob = blob
@path = name
@version = commit
self
else
nil
if commit = @wiki.repo.commit(version)
if blob = commit.tree / name
@blob = blob
@path = name
@version = commit
self
end
end
end
end