git ssb

0+

cel / pull-git-remote-helper



Commit 8abcce7cf104e77dbb7a4c2f6175031ea9dbab55

Fix fetch with no haves

Charles Lehner committed on 7/30/2016, 9:35:29 PM
Parent: e6b9c24e5ee9397fd4807d48300ea1511f41a55e

Files changed

index.jschanged
index.jsView
@@ -72,9 +72,9 @@
7272 var wants = {}
7373 var shallows = {}
7474 var aborted
7575 var hasWants
76- var gotWants
76+ var gotWants, gotHaves
7777
7878 function readWant(abort, cb) {
7979 if (abort) return
8080 // read upload request (wants list) from client
@@ -104,8 +104,14 @@
104104 // TODO: implement multi_ack_detailed
105105 if (abort) return
106106 readWantHave(null, function next(end, have) {
107107 if (end === true) {
108+ gotHaves = true
109+ if (!acked) {
110+ cb(null, 'NAK')
111+ } else {
112+ cb(true)
113+ }
108114 cb(true)
109115 } else if (have.type === 'flush-pkt') {
110116 // found no common object
111117 if (!acked) {
@@ -137,9 +143,10 @@
137143 sendRefs,
138144 pull.once(''),
139145 function (abort, cb) {
140146 if (!gotWants) readWant(abort, cb)
141- else readHave(abort, cb)
147+ else if (!gotHaves) readHave(abort, cb)
148+ else cb(true)
142149 }
143150 ])),
144151
145152 function (abort, cb) {

Built with git-ssb-web