./lib/dolt/sinatra/actions.rb in dolt-0.6.1 vs ./lib/dolt/sinatra/actions.rb in dolt-0.6.2
- old
+ new
@@ -46,47 +46,47 @@
})
end
def blob(repo, ref, path, options = { :template => :blob, :content_type => "text/html" })
actions.blob(repo, ref, path) do |err, data|
- return error(err, repo, ref) if !err.nil?
+ next error(err, repo, ref) if !err.nil?
blob = data[:blob]
- return redirect(tree_url(repo, ref, path)) if !blob.is_a?(Rugged::Blob)
+ next redirect(tree_url(repo, ref, path)) if !blob.is_a?(Rugged::Blob)
response["Content-Type"] = options[:content_type]
tpl_options = options[:template_options] || {}
body(renderer.render(options[:template], data, tpl_options))
end
end
def tree(repo, ref, path)
actions.tree(repo, ref, path) do |err, data|
- return error(err, repo, ref) if !err.nil?
+ next error(err, repo, ref) if !err.nil?
tree = data[:tree]
- return redirect(blob_url(repo, ref, path)) if tree.class.to_s !~ /\bTree/
+ next redirect(blob_url(repo, ref, path)) if tree.class.to_s !~ /\bTree/
response["Content-Type"] = "text/html"
body(renderer.render(:tree, data))
end
end
def blame(repo, ref, path)
actions.blame(repo, ref, path) do |err, data|
- return error(err, repo, ref) if !err.nil?
+ next error(err, repo, ref) if !err.nil?
response["Content-Type"] = "text/html"
body(renderer.render(:blame, data))
end
end
def history(repo, ref, path, count)
actions.history(repo, ref, path, count) do |err, data|
- return error(err, repo, ref) if !err.nil?
+ next error(err, repo, ref) if !err.nil?
response["Content-Type"] = "text/html"
body(renderer.render(:commits, data))
end
end
def refs(repo)
actions.refs(repo) do |err, data|
- return error(err, repo, ref) if !err.nil?
+ next error(err, repo, ref) if !err.nil?
response["Content-Type"] = "application/json"
body(renderer.render(:refs, data, :layout => nil))
end
end