From 4c0f6af3d9a1453510fbb3abd14ca936802286a0 Mon Sep 17 00:00:00 2001 From: Chris Ball Date: Fri, 29 May 2015 12:17:52 -0400 Subject: git-remote-gitswram: Ask for a download stream directly --- git-remote-gittorrent | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/git-remote-gittorrent b/git-remote-gittorrent index ea1bc38..49c8363 100755 --- a/git-remote-gittorrent +++ b/git-remote-gittorrent @@ -120,12 +120,9 @@ function get_infohash (ref) { client.download(infoHash, function (torrent) { console.warn('Downloading git pack with infohash: ' + chalk.green(infoHash) + '\n') torrent.on('done', function (done) { - var filename = torrent.storage.path + '/' + torrent.files[0].path + var stream = torrent.files[0].createReadStream() var unpack = spawn('git', ['index-pack', '--stdin', '-v', '--fix-thin']) - var stream = fs.createReadStream(filename) - stream.on('open', function () { - stream.pipe(unpack.stdin) - }) + stream.pipe(unpack.stdin) unpack.stderr.pipe(process.stderr) unpack.on('exit', function (code) { var targetdir = process.env['GIT_DIR'] -- cgit v1.2.3