From 0053042f2b06e3e73421d72ddc8a3e899155893c Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 17 Apr 2017 16:12:55 -0700 Subject: Render git-repo forks --- lib/render-msg.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/render-msg.js b/lib/render-msg.js index 407a963..eadbcd1 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -403,12 +403,19 @@ RenderMsg.prototype.channel = function (cb) { } RenderMsg.prototype.gitRepo = function (cb) { - this.wrapMini([ - 'git clone ', - h('code', h('small', 'ssb://' + this.msg.key)), - this.c.name ? [' ', h('a', {href: this.toUrl(this.msg.key)}, - this.c.name)] : '' - ], cb) + var self = this + var id = self.msg.key + var name = self.c.name + var upstream = self.c.upstream + self.link(upstream, function (err, upstreamA) { + if (err) upstreamA = ('a', {href: self.toUrl(upstream)}, String(name)) + self.wrapMini([ + upstream ? ['forked ', upstreamA, ': '] : '', + 'git clone ', + h('code', h('small', 'ssb://' + id)), + name ? [' ', h('a', {href: self.toUrl(id)}, String(name))] : '' + ], cb) + }) } RenderMsg.prototype.gitUpdate = function (cb) { -- cgit v1.2.3