aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-08-23 14:33:32 -0700
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-08-23 14:33:32 -0700
commit53835071d2485b1589498e802d847ce7d69f901a (patch)
tree514c8623bdaae989c346c160801ce913ad19ea58
parent679e08e0da36f829ffd8ec60e9e3beecab4b5925 (diff)
downloadpatchfoo-53835071d2485b1589498e802d847ce7d69f901a.tar.gz
patchfoo-53835071d2485b1589498e802d847ce7d69f901a.zip
Fix rendering deleted git branches
-rw-r--r--lib/render-msg.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index c0de668..316709e 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -723,6 +723,10 @@ RenderMsg.prototype.gitRepo = function (cb) {
})
}
+function asString(str) {
+ return str ? String(str) : str
+}
+
RenderMsg.prototype.gitUpdate = function (cb) {
var self = this
// h('a', {href: self.toUrl(self.c.repo)}, 'ssb://' + self.c.repo),
@@ -740,7 +744,7 @@ RenderMsg.prototype.gitUpdate = function (cb) {
'git push ', a, ' ',
!isNaN(size) ? [self.render.formatSize(size), ' '] : '',
self.c.refs ? h('ul', Object.keys(self.c.refs).map(function (ref) {
- var id = String(self.c.refs[ref])
+ var id = asString(self.c.refs[ref])
var type = /^refs\/tags/.test(ref) ? 'tag' : 'commit'
var path = id && ('/git/' + type + '/' + encodeURIComponent(id)
+ '?msg=' + encodeURIComponent(self.msg.key))