git ssb

0+

cel / pull-git-remote-helper



Commit ae9b54b013d2d66a40e22128321e90346c34ec36

Handle patched object stream ending

Charles Lehner committed on 2/19/2016, 3:27:14 AM
Parent: 63c93377c19466e121eaad5590e88488ac8fe5ee

Files changed

lib/pack.jschanged
lib/pack.jsView
@@ -262,8 +262,9 @@
262262
263263 function patchObject(deltaB, deltaLength, srcObject, targetLength, cb) {
264264 var readByte = deltaB.chunks(1)
265265 var srcBuf
266+ var ended
266267
267268 // console.error('patching', srcObject.type, targetLength)
268269 pull(
269270 srcObject.read,
@@ -277,10 +278,11 @@
277278 })
278279 )
279280
280281 function read(abort, cb) {
282+ if (ended) return cb(ended)
281283 readByte(null, function (end, dBuf) {
282- if (end) return cb(end)
284+ if (ended = end) return cb(end)
283285 var cmd = dBuf[0]
284286 if (cmd & 0x80)
285287 // skip a variable amount and then pass through a variable amount
286288 readOffsetSize(cmd, deltaB, function (err, offset, size) {

Built with git-ssb-web