git ssb

0+

cel / pull-git-remote-helper



Commit bdba6f9c69ed12a05f539cda2155bae439a07a78

Wrap repos in pull-git-repo to access packed objects

Charles Lehner committed on 3/6/2016, 11:10:59 PM
Parent: cf3e042658b75b328309f0f7f47d952ea5d5fa72

Files changed

index.jschanged
package.jsonchanged
index.jsView
@@ -1,8 +1,9 @@
11 var pull = require('pull-stream')
22 var cat = require('pull-cat')
33 var cache = require('pull-cache')
44 var buffered = require('pull-buffered')
5+var Repo = require('pull-git-repo')
56 var pack = require('pull-git-pack')
67 var pktLine = require('./lib/pkt-line')
78 var indexPack = require('./lib/index-pack')
89 var util = require('./lib/util')
@@ -115,9 +116,9 @@
115116 cb(end)
116117 else if (have.type != 'have')
117118 cb(new Error('Unknown have' + JSON.stringify(have)))
118119 else
119- repo.hasObject(have.hash, function (err, haveIt) {
120+ repo.hasObjectFromAny(have.hash, function (err, haveIt) {
120121 if (err) return cb(err)
121122 if (!haveIt)
122123 return readHave(null, next)
123124 commonHash = haveIt
@@ -203,9 +204,9 @@
203204 function addObject(hash, cb) {
204205 if (ended) return cb(ended)
205206 if (hash in objectsAdded || hash == commonHash) return cb()
206207 objectsAdded[hash] = true
207- repo.getObject(hash, function (err, object) {
208+ repo.getObjectFromAny(hash, function (err, object) {
208209 if (err) return cb(err)
209210 if (object.type == 'blob') {
210211 objects.push(object)
211212 cb()
@@ -430,8 +431,10 @@
430431 verbosity: 1,
431432 progress: false
432433 }
433434
435+ repo = Repo(repo)
436+
434437 function handleConnect(cmd, read) {
435438 var args = util.split2(cmd)
436439 switch (args[0]) {
437440 case 'git-upload-pack':
package.jsonView
@@ -28,8 +28,9 @@
2828 "pull-buffered": "^0.3.0",
2929 "pull-cache": "^0.0.0",
3030 "pull-cat": "^1.1.8",
3131 "pull-git-pack": "^0.0.0",
32+ "pull-git-repo": "^0.2.1",
3233 "pull-hash": "^0.0.0",
3334 "pull-stream": "^3.1.0",
3435 "stream-to-pull-stream": "^1.6.6"
3536 },

Built with git-ssb-web