From 53835071d2485b1589498e802d847ce7d69f901a Mon Sep 17 00:00:00 2001 From: cel Date: Thu, 23 Aug 2018 14:33:32 -0700 Subject: Fix rendering deleted git branches --- lib/render-msg.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') 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)) -- cgit v1.2.3