git ssb

0+

cel / pull-git-remote-helper



Commit 972b77c21531a8e0c42394380dd3331262f938f9

Use pull.once

Charles Lehner committed on 2/8/2016, 4:37:24 AM
Parent: b634a730e0a867de83e309323cb2c57c2714d0da

Files changed

index.jschanged
index.jsView
@@ -27,21 +27,10 @@
2727 read(null, next)
2828 })
2929 }
3030
31-// return a source that delivers some data and then ends
32-// TODO: use pull.once and abortCb for this
33-function endSource(data) {
34- var done
35- return function (end, cb) {
36- if (done) return cb(true)
37- done = true
38- cb(null, data)
39- }
40-}
41-
4231 function capabilitiesSource(prefix) {
43- return endSource([
32+ return pull.once([
4433 'option',
4534 'connect',
4635 'refspec refs/heads/*:refs/' + prefix + '/heads/*',
4736 'refspec refs/tags/*:refs/' + prefix + '/tags/*',
@@ -66,13 +55,13 @@
6655 var msg = handleOption(options, args[0], args[1])
6756 msg = (msg === true) ? 'ok'
6857 : (msg === false) ? 'unsupported'
6958 : 'error ' + msg
70- return endSource(msg + '\n')
59+ return pull.once(msg + '\n')
7160 }
7261
7362 function listSource() {
74- return endSource([
63+ return pull.once([
7564 /* TODO */
7665 ].join('\n') + '\n\n')
7766 }
7867

Built with git-ssb-web