diff options
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r-- | lib/render-msg.js | 19 |
1 files 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) { |