Commit 0aa086743bf95bef63b8c225ba6a5b9848131c76
Handle receiving thin packs
Charles Lehner committed on 3/7/2016, 3:50:40 AMParent: bdba6f9c69ed12a05f539cda2155bae439a07a78
Files changed
lib/index-pack.js | changed |
lib/index-pack.js | ||
---|---|---|
@@ -9,15 +9,15 @@ | ||
9 | 9 | var name = Math.random().toString(36).substr(2) |
10 | 10 | var indexFilename = path.join(os.tmpdir(), name + '.idx') |
11 | 11 | var packFilename = path.join(os.tmpdir(), name + '.pack') |
12 | 12 | |
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], { | |
15 | 15 | stdio: ['pipe', 'pipe', 'inherit'] |
16 | 16 | }) |
17 | 17 | pull(packFile, toPull.sink(child.stdin)) |
18 | 18 | child.on('close', function (err) { |
19 | - if (err) return cb(err) | |
19 | + if (err) return cb(new Error('git index-pack returned ' + err)) | |
20 | 20 | fs.unlink(packFilename, function (err) { |
21 | 21 | if (err) return cb(err) |
22 | 22 | cb(null, toPull(fs.createReadStream(indexFilename), function (err) { |
23 | 23 | if (err) return console.error(err) |
Built with git-ssb-web