git ssb

0+

cel / pull-git-remote-helper



Commit 907ec2fc5b45d1e87305436e74c01c7e455a29ef

Handle optional onEnd and opts arguments in pack

Charles Lehner committed on 2/26/2016, 10:53:51 PM
Parent: 1a425fdfb01339affe3481c9edff4453555b9f4d

Files changed

lib/pack.jschanged
lib/pack.jsView
@@ -97,8 +97,11 @@
9797
9898 function decodePack(opts, repo, onEnd, read) {
9999 if (read === undefined)
100100 return decodePack.bind(this, opts, repo, onEnd)
101+ onEnd = onEnd || function(err) {
102+ if (err) throw err
103+ }
101104
102105 var ended
103106 var numObjects = -1
104107 var checksum = createHash('sha1')
@@ -370,10 +373,12 @@
370373 cb(null, new Buffer(vals))
371374 }
372375
373376 function encodePack(opts, numObjects, readObject) {
377+ if (numObjects === undefined)
378+ numObjects = opts, opts = null
374379 if (readObject === undefined)
375- return encodePack.bind(this, numObjects)
380+ return encodePack.bind(this, opts, numObjects)
376381
377382 var header = new Buffer(12)
378383 header.write('PACK')
379384 header.writeUInt32BE(PACK_VERSION, 4)

Built with git-ssb-web