aboutsummaryrefslogtreecommitdiff
path: root/lib/serve.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-06-03 11:53:21 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-06-03 12:37:01 -1000
commit4d96b6e0f7b726a5d96742e51fcb6c05b1d3f85f (patch)
tree21b82ee95357c8f232a2a5fa486b16e26b845b07 /lib/serve.js
parent81e06ce58a3a4a09b7c6c2837e8076ecec6e38e3 (diff)
downloadpatchfoo-4d96b6e0f7b726a5d96742e51fcb6c05b1d3f85f.tar.gz
patchfoo-4d96b6e0f7b726a5d96742e51fcb6c05b1d3f85f.zip
Show commit files changed
Diffstat (limited to 'lib/serve.js')
-rw-r--r--lib/serve.js26
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/serve.js b/lib/serve.js
index d2510e1..59a09d5 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -1440,6 +1440,21 @@ Serve.prototype.gitCommit = function (rev) {
)]) : '',
h('blockquote',
self.app.render.gitCommitBody(commit.body)).outerHTML,
+ ph('h4', 'files'),
+ ph('table', pull(
+ self.app.git.readCommitChanges(commit),
+ pull.map(function (file) {
+ return ph('tr', [
+ ph('td', ph('code', u.escapeHTML(file.name))),
+ // ph('td', ph('code', u.escapeHTML(JSON.stringify(file.msg)))),
+ ph('td', file.deleted ? 'deleted'
+ : file.created ? 'created'
+ : file.hash ? 'changed'
+ : file.mode ? 'mode changed'
+ : JSON.stringify(file))
+ ])
+ })
+ ))
]
]),
self.wrapPage('git commit ' + rev),
@@ -1572,20 +1587,19 @@ Serve.prototype.gitTree = function (rev) {
})
}, 8),
pull.map(function (item) {
- var type = item.mode === 0040000 ? 'tree' :
- item.mode === 0160000 ? 'commit' : 'blob'
if (!item.msg) return ph('tr', [
ph('td',
- u.escapeHTML(item.name) + (type === 'tree' ? '/' : '')),
+ u.escapeHTML(item.name) + (item.type === 'tree' ? '/' : '')),
+ ph('td', u.escapeHTML(item.hash)),
ph('td', 'missing')
])
- var path = '/git/' + type + '/' + item.hash
+ var path = '/git/' + item.type + '/' + item.hash
+ '?msg=' + encodeURIComponent(item.msg.key)
var fileDate = new Date(item.msg.value.timestamp)
return ph('tr', [
ph('td',
ph('a', {href: self.app.render.toUrl(path)},
- u.escapeHTML(item.name) + (type === 'tree' ? '/' : ''))),
+ u.escapeHTML(item.name) + (item.type === 'tree' ? '/' : ''))),
ph('td',
self.phIdLink(item.msg.value.author)),
ph('td',
@@ -1748,7 +1762,7 @@ Serve.prototype.askWantBlobsForm = function (links) {
if (!u.isRef(link.link)) return
return ph('tr', [
ph('td', ph('code', link.link)),
- ph('td', self.app.render.formatSize(link.size)),
+ !isNaN(link.size) ? ph('td', self.app.render.formatSize(link.size)) : '',
])
})),
ph('input', {type: 'hidden', name: 'action', value: 'want-blobs'}),