diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-12-25 10:20:12 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-12-25 11:21:25 -1000 |
commit | 704394335d188f98074906558c73db228c571690 (patch) | |
tree | a3e5314b649af6acb92e352e512fa8cce9e9e771 /lib | |
parent | 6646ec3620bff75ffca314d5c0eb5019ea7c52e1 (diff) | |
download | patchfoo-704394335d188f98074906558c73db228c571690.tar.gz patchfoo-704394335d188f98074906558c73db228c571690.zip |
Handle more missing git blobs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/app.js | 2 | ||||
-rw-r--r-- | lib/serve.js | 4 |
2 files changed, 5 insertions, 1 deletions
@@ -295,7 +295,7 @@ App.prototype.readBlobSlice = function (link, opts) { App.prototype.ensureHasBlobs = function (links, cb) { var self = this var done = multicb({pluck: 1}) - links.forEach(function (link) { + links.filter(Boolean).forEach(function (link) { var cb = done() self.sbot.blobs.size(link.link, function (err, size) { if (err) cb(err) diff --git a/lib/serve.js b/lib/serve.js index 40f92a8..73e209c 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -1896,12 +1896,16 @@ Serve.prototype.gitTree = function (rev) { headMsgId: obj.msg.key, }, function (err, msg) { if (err && err.name === 'ObjectNotFoundError') return cb(null, file) + if (err && err.name === 'BlobNotFoundError') return cb(null, {missingBlobs: err.links}) if (err) return cb(err) file.msg = msg cb(null, file) }) }, 8), pull.map(function (item) { + if (item.missingBlobs) { + return self.askWantBlobsForm(item.missingBlobs) + } if (!item.msg) return ph('tr', [ ph('td', u.escapeHTML(item.name) + (item.type === 'tree' ? '/' : '')), |