diff options
Diffstat (limited to 'lib/git.js')
-rw-r--r-- | lib/git.js | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -7,6 +7,7 @@ var packidx = require('pull-git-packidx-parser') var Reader = require('pull-reader') var toPull = require('stream-to-pull-stream') var zlib = require('zlib') +var looper = require('looper') var ObjectNotFoundError = u.customError('ObjectNotFoundError') @@ -501,12 +502,16 @@ Git.prototype.getTag = function (obj, cb) { function readCString(reader, cb) { var chars = [] - reader.read(1, function next(err, ch) { + var loop = looper(function () { + reader.read(1, next) + }) + function next(err, ch) { if (err) return cb(err) if (ch[0] === 0) return cb(null, Buffer.concat(chars).toString('utf8')) chars.push(ch) - reader.read(1, next) - }) + loop() + } + loop() } Git.prototype.readTree = function (obj) { |