Commit ed1a05614a2839f00048232d40536e714bc8c0f8
Don't show branch info on empty repo
cel committed on 11/22/2016, 3:07:03 AMParent: 5dba96e0853a4d7f84670f78b8043ab9bd5adc08
Files changed
lib/repos/index.js | changed |
lib/repos/index.js | ||
---|---|---|
@@ -293,8 +293,9 @@ | ||
293 | 293 … | (repo.head == `refs/heads/${rev}` ? '' : `@${rev}`) |
294 | 294 … | |
295 | 295 … | return this.serveRepoTemplate(req, repo, 'code', rev, title, |
296 | 296 … | u.readNext((cb) => { |
297 … | + if (!rev) return cb(null, this.renderEmptyRepo(req, repo)) | |
297 | 298 … | repo.getLatestAvailableRev(rev, 10e3, (err, revGot, numSkipped) => { |
298 | 299 … | if (err) return cb(err) |
299 | 300 … | cb(null, cat([ |
300 | 301 … | h('section', {class: 'branch-info light-grey', method: 'get'}, [ |
@@ -310,12 +311,10 @@ | ||
310 | 311 … | ) |
311 | 312 … | ), |
312 | 313 … | u.when(type === 'Branch', () => renderRepoLatest(req, repo, revGot)) |
313 | 314 … | ]), |
314 | - rev ? cat([ | |
315 | - h('section', {class: 'files'}, renderRepoTree(req, repo, revGot, path)), | |
316 | - this.renderRepoReadme(req, repo, revGot, path) | |
317 | - ]) : this.renderEmptyRepo(req, repo) | |
315 … | + h('section', {class: 'files'}, renderRepoTree(req, repo, revGot, path)), | |
316 … | + this.renderRepoReadme(req, repo, revGot, path) | |
318 | 317 … | ])) |
319 | 318 … | }) |
320 | 319 … | })) |
321 | 320 … | } |
Built with git-ssb-web