Permalink
Browse files

add sha method

  • Loading branch information...
DmitryBochkarev committed Jun 2, 2012
1 parent 92edc59 commit e3f7669bed003feaf3e2467e4ca50cfe2b7e935a
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/git.coffee
View
@@ -64,9 +64,13 @@ module.exports = class Git
@run cmd, (err, dump) ->
done undefined, {objects: parseTreeDump(dump)}
+ sha: (rev, done) ->
+ cmd = "git rev-parse #{rev}"
+ @run cmd, (err, sha) ->
+ done undefined, sha
+
objectByPath: (rev, path, done) ->
- cmd = "git rev-parse #{rev}:#{path}"
- @run cmd, (err, sha) =>
+ @sha "#{rev}:#{path}", (err, sha) =>
@object "#{sha}".trim(), done

0 comments on commit e3f7669

Please sign in to comment.