./lib/dolt/sinatra/actions.rb in dolt-0.8.0 vs ./lib/dolt/sinatra/actions.rb in dolt-0.9.0
- old
+ new
@@ -83,9 +83,21 @@
error(err, repo, ref)
end
end
end
+ def tree_entry(repo, ref, path)
+ actions.tree_entry(repo, ref, path) do |err, data|
+ begin
+ next error(err, repo, ref) if !err.nil?
+ response["Content-Type"] = "text/html"
+ body(renderer.render(data.key?(:tree) ? :tree : :blob, data))
+ rescue Exception => err
+ error(err, repo, ref)
+ end
+ end
+ end
+
def blame(repo, ref, path)
actions.blame(repo, ref, path) do |err, data|
next error(err, repo, ref) if !err.nil?
response["Content-Type"] = "text/html"
body(renderer.render(:blame, data))