git ssb

0+

cel / pull-git-pack-concat



Commit b2606aaae852e50f39ef35d8630a33ac2a744e71

Fix forEachAsync

Charles Lehner committed on 10/13/2016, 6:21:56 PM
Parent: b53631fba4f93f901e325267c230dc8f2ea06f91

Files changed

index.jschanged
index.jsView
@@ -16,11 +16,11 @@
1616
1717 function forEachAsync(arr, fn, cb) {
1818 var i = 0
1919 loop(function (next) {
20- if (i >= arr.length) return cb()
20 + if (i >= arr.length) return cb && cb()
2121 fn(arr[i++], function (err) {
22- if (err) return cb(err)
22 + if (err) return cb && cb(err)
2323 next()
2424 })
2525 })
2626 }
@@ -103,9 +103,9 @@
103103
104104 function closePacks(packs, cb) {
105105 forEachAsync(packs, function (pack, cb) {
106106 pack.read(true, cb)
107- })
107 + }, cb)
108108 }
109109
110110 module.exports = function concatPacks(packs) {
111111 /* packs: [{read: source, numObjects: int}] */

Built with git-ssb-web