git ssb

30+

cel / git-ssb-web



Commit 5aa798d79976877077d73285debd83d7843f9482

Show repo forks in feed

Charles Lehner committed on 4/4/2016, 10:49:05 PM
Parent: 6839527655b266fe0e7ea9e840a892514428e492

Files changed

index.jschanged
index.jsView
@@ -804,14 +804,25 @@
804804 var author = msg.value.author
805805 var authorLink = link([msg.value.author], msg.authorName)
806806 switch (c.type) {
807807 case 'git-repo':
808- return getRepoName(about, author, msg.key, function (err, repoName) {
809- if (err) return cb(err)
810- var repoLink = link([msg.key], repoName)
811- cb(null, '<section class="collapse">' + msgLink + '<br>' +
812- authorLink + ' created repo ' + repoLink + '</section>')
813- })
808+ var done = multicb({ pluck: 1, spread: true })
809+ getRepoName(about, author, msg.key, done())
810+ if (c.upstream) {
811+ getRepoName(about, author, c.upstream, done())
812+ return done(function (err, repoName, upstreamName) {
813+ cb(null, '<section class="collapse">' + msgLink + '<br>' +
814+ authorLink + ' forked ' + link([c.upstream], upstreamName) +
815+ ' to ' + link([msg.key], repoName) + '</section>')
816+ })
817+ } else {
818+ return done(function (err, repoName) {
819+ if (err) return cb(err)
820+ var repoLink = link([msg.key], repoName)
821+ cb(null, '<section class="collapse">' + msgLink + '<br>' +
822+ authorLink + ' created repo ' + repoLink + '</section>')
823+ })
824+ }
814825 case 'git-update':
815826 return getRepoName(about, author, c.repo, function (err, repoName) {
816827 if (err) return cb(err)
817828 var repoLink = link([c.repo], repoName)

Built with git-ssb-web