aboutsummaryrefslogtreecommitdiff
path: root/git-remote-gittorrent
diff options
context:
space:
mode:
Diffstat (limited to 'git-remote-gittorrent')
-rwxr-xr-xgit-remote-gittorrent12
1 files changed, 3 insertions, 9 deletions
diff --git a/git-remote-gittorrent b/git-remote-gittorrent
index ad9825b..bb76dc8 100755
--- a/git-remote-gittorrent
+++ b/git-remote-gittorrent
@@ -125,13 +125,6 @@ dht.on('peer', function (addr, hash, from) {
goal.swarm.addPeer(addr)
})
-function update_ref (sha) {
- fetching[sha].branches.forEach(function (branch) {
- branch = remotename + '/' + branch
- spawn('git', ['update-ref', branch, sha])
- })
-}
-
function get_infohash (sha, branch) {
branch = branch.replace(/^refs\/(heads\/)?/, '')
branch = branch.replace(/\/head$/, '')
@@ -170,8 +163,10 @@ function get_infohash (sha, branch) {
tracker: false
})
client.download(infoHash, function (torrent) {
- console.warn('Downloading git pack with infohash: ' + chalk.green(infoHash) + '\n')
+ console.warn('Downloading ' + chalk.green(torrent.files[0].path) +
+ ' with infohash: ' + chalk.green(infoHash) + '\n')
torrent.on('done', function (done) {
+ console.warn('done downloading: ' + chalk.green(torrent.files[0].path))
fetching[sha].got = true
var stream = torrent.files[0].createReadStream()
@@ -179,7 +174,6 @@ function get_infohash (sha, branch) {
stream.pipe(unpack.stdin)
unpack.stderr.pipe(process.stderr)
unpack.on('exit', function (code) {
- update_ref(sha)
todo--
if (todo <= 0) {
// These writes are actually necessary for git to finish