git ssb

30+

cel / git-ssb-web



Commit fcfe11a278429f351696774edb26b410c3d07c49

Handle PRs with no commits

cel committed on 10/20/2016, 7:51:43 PM
Parent: e29d62252ebe485a58bec4fc24bb76d0913626a2

Files changed

lib/repos/pulls.jschanged
locale/en.jsonchanged
locale/eo.jsonchanged
package.jsonchanged
lib/repos/pulls.jsView
@@ -90,8 +90,10 @@
9090 P.renderPullReqCommits = function (req, pr, baseRepo, headRepo, cb) {
9191 var self = this
9292 self.web.pullReqs.getRevs(pr.id, function (err, revs) {
9393 if (err) return cb(err)
94 + if (!revs.head) return cb(null, pull.once('<section>' +
95 + req._t('pullRequest.NoCommits') + '</section>'))
9496 GitRepo.getMergeBase(baseRepo, revs.base, headRepo, revs.head,
9597 function (err, mergeBase) {
9698 if (err) return cb(err)
9799 cb(null, cat([
@@ -107,8 +109,10 @@
107109 P.renderPullReqFiles = function (req, pr, baseRepo, headRepo, cb) {
108110 var self = this
109111 self.web.pullReqs.getRevs(pr.id, function (err, revs) {
110112 if (err) return cb(err)
113 + if (!revs.head) return cb(null, pull.once('<section>' +
114 + req._t('pullRequest.NoChanges') + '</section>'))
111115 GitRepo.getMergeBase(baseRepo, revs.base, headRepo, revs.head,
112116 function (err, mergeBase) {
113117 if (err) return cb(err)
114118 cb(null, cat([
locale/en.jsonView
@@ -133,9 +133,11 @@
133133 },
134134 "pullRequest": {
135135 "WantToMerge": "%{name} wants to merge commits into %{base} from %{head}",
136136 "Discussion": "Discussion",
137- "New": "New Pull Request"
137 + "New": "New Pull Request",
138 + "NoCommits": "No commits",
139 + "NoChanges": "No changes"
138140 },
139141 "NameDeletedBranch": "%{name} deleted the %{branch} branch",
140142 "NameUpdatedBranch": "%{name} updated the branch to %{rev}",
141143 "CompareChanges": "Compare changes",
locale/eo.jsonView
@@ -133,9 +133,11 @@
133133 },
134134 "pullRequest": {
135135 "WantToMerge": "%{name} volas kunfandi enmetoj en %{base} de %{head}",
136136 "Discussion": "Priparolado",
137- "New": "Nova Tiro-peto"
137 + "New": "Nova Tiro-peto",
138 + "NoCommits": "Neniuj enmetoj",
139 + "NoChanges": "Neniuj ŝanĝoj"
138140 },
139141 "NameDeletedBranch": "%{name} fermiĝis la %{branch} branĉon",
140142 "NameUpdatedBranch": "%{name} ĝisdatigis la branĉon al %{rev}",
141143 "CompareChanges": "Kompari ŝanĝojn",
package.jsonView
@@ -25,9 +25,9 @@
2525 "ssb-keys": "^6.1.1",
2626 "ssb-marked": "^0.6.0",
2727 "ssb-mentions": "^0.1.0",
2828 "ssb-msg-schemas": "^6.1.1",
29- "ssb-pull-requests": "^0.2.0",
29 + "ssb-pull-requests": "^0.2.2",
3030 "ssb-reconnect": "^0.1.0",
3131 "ssb-ref": "^2.6.1",
3232 "stream-to-pull-stream": "^1.7.2"
3333 },

Built with git-ssb-web