aboutsummaryrefslogtreecommitdiff
path: root/git-remote-gittorrent
diff options
context:
space:
mode:
authorChris Ball <chris@printf.net>2015-05-29 12:17:52 -0400
committerChris Ball <chris@printf.net>2015-05-29 12:17:52 -0400
commit4c0f6af3d9a1453510fbb3abd14ca936802286a0 (patch)
tree89680231863a1c949e3286b95b9d604d984881c5 /git-remote-gittorrent
parent5cf08cb421526181eb41e4db0e33508fbe9b887e (diff)
git-remote-gitswram: Ask for a download stream directly
Diffstat (limited to 'git-remote-gittorrent')
-rwxr-xr-xgit-remote-gittorrent7
1 files 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']