aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-04-17 16:12:55 -0700
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-04-17 16:12:55 -0700
commit0053042f2b06e3e73421d72ddc8a3e899155893c (patch)
treeeff973f9c533098240cab417d20c7a6b9b495a71
parent6c063d17f531ae299745c431dcccb306081f9f94 (diff)
downloadpatchfoo-0053042f2b06e3e73421d72ddc8a3e899155893c.tar.gz
patchfoo-0053042f2b06e3e73421d72ddc8a3e899155893c.zip
Render git-repo forks
-rw-r--r--lib/render-msg.js19
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) {