aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-12-25 10:20:12 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-12-25 11:21:25 -1000
commit704394335d188f98074906558c73db228c571690 (patch)
treea3e5314b649af6acb92e352e512fa8cce9e9e771
parent6646ec3620bff75ffca314d5c0eb5019ea7c52e1 (diff)
downloadpatchfoo-704394335d188f98074906558c73db228c571690.tar.gz
patchfoo-704394335d188f98074906558c73db228c571690.zip
Handle more missing git blobs
-rw-r--r--lib/app.js2
-rw-r--r--lib/serve.js4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/app.js b/lib/app.js
index 1c3647b..4789e11 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -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' ? '/' : '')),