git ssb

0+

cel / pull-git-remote-helper



Commit 0aa086743bf95bef63b8c225ba6a5b9848131c76

Handle receiving thin packs

Charles Lehner committed on 3/7/2016, 3:50:40 AM
Parent: bdba6f9c69ed12a05f539cda2155bae439a07a78

Files changed

lib/index-pack.jschanged
lib/index-pack.jsView
@@ -9,15 +9,15 @@
99 var name = Math.random().toString(36).substr(2)
1010 var indexFilename = path.join(os.tmpdir(), name + '.idx')
1111 var packFilename = path.join(os.tmpdir(), name + '.pack')
1212
13- var args = ['index-pack', '--stdin', '-o', indexFilename, packFilename]
14- var child = cp.spawn('git', args, {
13+ var child = cp.spawn('git', ['index-pack', '--stdin', '--fix-thin',
14+ '-o', indexFilename, packFilename], {
1515 stdio: ['pipe', 'pipe', 'inherit']
1616 })
1717 pull(packFile, toPull.sink(child.stdin))
1818 child.on('close', function (err) {
19- if (err) return cb(err)
19+ if (err) return cb(new Error('git index-pack returned ' + err))
2020 fs.unlink(packFilename, function (err) {
2121 if (err) return cb(err)
2222 cb(null, toPull(fs.createReadStream(indexFilename), function (err) {
2323 if (err) return console.error(err)

Built with git-ssb-web