./lib/dolt/repo_actions.rb in dolt-0.1.0 vs ./lib/dolt/repo_actions.rb in dolt-0.1.1
- old
+ new
@@ -21,15 +21,27 @@
class RepoActions
def initialize(repo_resolver)
@repo_resolver = repo_resolver
end
- def blob(repo, ref, path, &block)
+ def blob(repo, path, ref, &block)
repository = repo_resolver.resolve(repo)
d = repository.blob(path, ref)
d.callback do |blob, status|
block.call(nil, {
:blob => blob,
+ :repository => repository,
+ :ref => ref })
+ end
+ d.errback { |err| block.call(err, nil) }
+ end
+
+ def tree(repo, path, ref, &block)
+ repository = repo_resolver.resolve(repo)
+ d = repository.tree(path, ref)
+ d.callback do |tree, status|
+ block.call(nil, {
+ :tree => tree,
:repository => repository,
:ref => ref })
end
d.errback { |err| block.call(err, nil) }
end