Commit fcfe11a278429f351696774edb26b410c3d07c49
Handle PRs with no commits
cel committed on 10/20/2016, 7:51:43 PMParent: e29d62252ebe485a58bec4fc24bb76d0913626a2
Files changed
lib/repos/pulls.js | changed |
locale/en.json | changed |
locale/eo.json | changed |
package.json | changed |
lib/repos/pulls.js | ||
---|---|---|
@@ -90,8 +90,10 @@ | ||
90 | 90 … | P.renderPullReqCommits = function (req, pr, baseRepo, headRepo, cb) { |
91 | 91 … | var self = this |
92 | 92 … | self.web.pullReqs.getRevs(pr.id, function (err, revs) { |
93 | 93 … | if (err) return cb(err) |
94 … | + if (!revs.head) return cb(null, pull.once('<section>' + | |
95 … | + req._t('pullRequest.NoCommits') + '</section>')) | |
94 | 96 … | GitRepo.getMergeBase(baseRepo, revs.base, headRepo, revs.head, |
95 | 97 … | function (err, mergeBase) { |
96 | 98 … | if (err) return cb(err) |
97 | 99 … | cb(null, cat([ |
@@ -107,8 +109,10 @@ | ||
107 | 109 … | P.renderPullReqFiles = function (req, pr, baseRepo, headRepo, cb) { |
108 | 110 … | var self = this |
109 | 111 … | self.web.pullReqs.getRevs(pr.id, function (err, revs) { |
110 | 112 … | if (err) return cb(err) |
113 … | + if (!revs.head) return cb(null, pull.once('<section>' + | |
114 … | + req._t('pullRequest.NoChanges') + '</section>')) | |
111 | 115 … | GitRepo.getMergeBase(baseRepo, revs.base, headRepo, revs.head, |
112 | 116 … | function (err, mergeBase) { |
113 | 117 … | if (err) return cb(err) |
114 | 118 … | cb(null, cat([ |
locale/en.json | ||
---|---|---|
@@ -133,9 +133,11 @@ | ||
133 | 133 … | }, |
134 | 134 … | "pullRequest": { |
135 | 135 … | "WantToMerge": "%{name} wants to merge commits into %{base} from %{head}", |
136 | 136 … | "Discussion": "Discussion", |
137 | - "New": "New Pull Request" | |
137 … | + "New": "New Pull Request", | |
138 … | + "NoCommits": "No commits", | |
139 … | + "NoChanges": "No changes" | |
138 | 140 … | }, |
139 | 141 … | "NameDeletedBranch": "%{name} deleted the %{branch} branch", |
140 | 142 … | "NameUpdatedBranch": "%{name} updated the branch to %{rev}", |
141 | 143 … | "CompareChanges": "Compare changes", |
locale/eo.json | ||
---|---|---|
@@ -133,9 +133,11 @@ | ||
133 | 133 … | }, |
134 | 134 … | "pullRequest": { |
135 | 135 … | "WantToMerge": "%{name} volas kunfandi enmetoj en %{base} de %{head}", |
136 | 136 … | "Discussion": "Priparolado", |
137 | - "New": "Nova Tiro-peto" | |
137 … | + "New": "Nova Tiro-peto", | |
138 … | + "NoCommits": "Neniuj enmetoj", | |
139 … | + "NoChanges": "Neniuj ŝanĝoj" | |
138 | 140 … | }, |
139 | 141 … | "NameDeletedBranch": "%{name} fermiĝis la %{branch} branĉon", |
140 | 142 … | "NameUpdatedBranch": "%{name} ĝisdatigis la branĉon al %{rev}", |
141 | 143 … | "CompareChanges": "Kompari ŝanĝojn", |
package.json | ||
---|---|---|
@@ -25,9 +25,9 @@ | ||
25 | 25 … | "ssb-keys": "^6.1.1", |
26 | 26 … | "ssb-marked": "^0.6.0", |
27 | 27 … | "ssb-mentions": "^0.1.0", |
28 | 28 … | "ssb-msg-schemas": "^6.1.1", |
29 | - "ssb-pull-requests": "^0.2.0", | |
29 … | + "ssb-pull-requests": "^0.2.2", | |
30 | 30 … | "ssb-reconnect": "^0.1.0", |
31 | 31 … | "ssb-ref": "^2.6.1", |
32 | 32 … | "stream-to-pull-stream": "^1.7.2" |
33 | 33 … | }, |
Built with git-ssb-web