mirror of
https://github.com/danog/gift.git
synced 2024-12-02 09:17:55 +01:00
18 lines
372 B
CoffeeScript
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}'>"
|