Commit 26e05692a6d576fbcd9a6e5099e11a1bd9e19f94
Fix rendering new pack/index updates
Charles Lehner committed on 3/22/2016, 5:16:17 AMParent: d2a325d379d224a5e19659923b01482d3c72aa21
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -779,8 +779,19 @@ | ||
779 | 779 | } |
780 | 780 | |
781 | 781 | function serveRepoUpdate(req, repo, id, msg, path) { |
782 | 782 | var raw = String(req._u.query).split('&').indexOf('raw') > -1 |
783 | + | |
784 | + // convert packs to old single-object style | |
785 | + if (msg.content.indexes) { | |
786 | + for (var i = 0; i < msg.content.indexes.length; i++) { | |
787 | + msg.content.packs[i] = { | |
788 | + pack: {link: msg.content.packs[i].link}, | |
789 | + idx: msg.content.indexes[i] | |
790 | + } | |
791 | + } | |
792 | + } | |
793 | + | |
783 | 794 | return renderRepoPage(repo, null, pull.once( |
784 | 795 | (raw ? '<a href="?" class="raw-link">Info</a>' : |
785 | 796 | '<a href="?raw" class="raw-link">Data</a>') + |
786 | 797 | '<h3>Update</h3>' + |
@@ -800,10 +811,10 @@ | ||
800 | 811 | } |
801 | 812 | |
802 | 813 | function renderPack(info) { |
803 | 814 | return '<section class="collapse">' + |
804 | - 'Pack: ' + link([info.pack.link]) + '<br>' + | |
805 | - 'Index: ' + link([info.idx.link]) + '</section>' | |
815 | + (info.pack ? 'Pack: ' + link([info.pack.link]) + '<br>' : '') + | |
816 | + (info.idx ? 'Index: ' + link([info.idx.link]) : '') + '</section>' | |
806 | 817 | } |
807 | 818 | |
808 | 819 | /* Blob */ |
809 | 820 |
Built with git-ssb-web