diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2020-02-14 17:28:14 -0500 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2020-02-14 17:28:14 -0500 |
commit | e1a9df691c91e6793204528df331894efe952484 (patch) | |
tree | 7d78ad6b6509e9ba2fdcfb9f34689bf7df8d6840 /lib | |
parent | 97da1aee50af959838fdaed3b85eb4fb47627ff0 (diff) | |
download | patchfoo-e1a9df691c91e6793204528df331894efe952484.tar.gz patchfoo-e1a9df691c91e6793204528df331894efe952484.zip |
Deduplicate git blob ids
Diffstat (limited to 'lib')
-rw-r--r-- | lib/serve.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/serve.js b/lib/serve.js index 562476d..96f8313 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -3418,13 +3418,21 @@ Serve.prototype.wrapPublic = function (opts) { }) } +function uniqueLink() { + var seen = {} + return function (link) { + if (seen[link.link]) return false + return seen[link.link] = true + } +} + Serve.prototype.askWantBlobsForm = function (links) { var self = this return ph('form', {action: '', method: 'post'}, [ ph('section', [ ph('h3', 'Missing blobs'), ph('p', 'The application needs these blobs to continue:'), - ph('table', links.map(u.toLink).map(function (link) { + ph('table', links.map(u.toLink).filter(uniqueLink()).map(function (link) { if (!u.isRef(link.link)) return return ph('tr', [ ph('td', ph('code', link.link)), |