1
0
mirror of https://github.com/danog/gift.git synced 2024-12-02 09:17:55 +01:00
gift/src/blob.coffee
2012-02-15 07:51:45 -07:00

18 lines
372 B
CoffeeScript

path = require 'path'
module.exports = class Blob
constructor: (@repo, attrs) ->
{@id, @name, @mode} = attrs
# Public: Get the blob contents.
#
# callback - Receives `(err, data)`.
#
data: (callback) ->
@repo.git "cat-file", {p: true}, @id
, (err, stdout, stderr) ->
return callback err, stdout
toString: ->
"#<Blob '#{@id}'>"