Commit a7f3b74c5bb6baf2129fd4ff15bb9eaea0e7567c
Merge upstream latest
Ev Bogue committed on 7/17/2016, 11:15:16 PMParent: 8a06021c8e2887b1f6bcb31c9fe4a835c7d2f7b5
Parent: 0b0753593eee0bace2669f35bab7cdc182cf203a
Files changed
lib/repos/index.js | changed |
package.json | changed |
lib/repos/index.js | ||
---|---|---|
@@ -106,9 +106,9 @@ | ||
106 | 106 … | return this.serveRepoCommits(req, repo, branch) |
107 | 107 … | case 'commit': |
108 | 108 … | return this.serveRepoCommit(req, repo, path[1]) |
109 | 109 … | case 'tag': |
110 | - return this.serveRepoTag(req, repo, branch) | |
110 … | + return this.serveRepoTag(req, repo, branch, filePath) | |
111 | 111 … | case 'tree': |
112 | 112 … | return this.serveRepoTree(req, repo, branch, filePath) |
113 | 113 … | case 'blob': |
114 | 114 … | return this.serveRepoBlob(req, repo, branch, filePath) |
@@ -544,25 +544,33 @@ | ||
544 | 544 … | } |
545 | 545 … | |
546 | 546 … | /* Repo tag */ |
547 | 547 … | |
548 | -R.serveRepoTag = function (req, repo, rev) { | |
548 … | +R.serveRepoTag = function (req, repo, rev, path) { | |
549 | 549 … | var self = this |
550 | 550 … | return u.readNext(function (cb) { |
551 | 551 … | repo.getTagParsed(rev, function (err, tag) { |
552 | - if (err) return cb(err) | |
552 … | + if (err) { | |
553 … | + if (/Expected tag, got commit/.test(err.message)) { | |
554 … | + req._u.pathname = u.encodeLink([repo.id, 'commit', rev].concat(path)) | |
555 … | + return cb(null, self.web.serveRedirect(req, url.format(req._u))) | |
556 … | + } | |
557 … | + return cb(null, self.web.serveError(req, err)) | |
558 … | + } | |
559 … | + | |
553 | 560 … | var title = req._t('TagName', { |
554 | 561 … | tag: u.escape(tag.tag) |
555 | 562 … | }) + ' · %{author}/%{repo}' |
556 | 563 … | var body = (tag.title + '\n\n' + |
557 | 564 … | tag.body.replace(/-----BEGIN PGP SIGNATURE-----\n[^.]*?\n-----END PGP SIGNATURE-----\s*$/, '')).trim() |
565 … | + var date = tag.tagger.date | |
558 | 566 … | cb(null, self.renderRepoPage(req, repo, 'tags', tag.object, title, |
559 | 567 … | pull.once( |
560 | 568 … | '<section class="collapse">' + |
561 | 569 … | '<h3>' + u.link([repo.id, 'tag', rev], tag.tag) + '</h3>' + |
562 | 570 … | req._t('TaggedOn', { |
563 | 571 … | name: u.escape(tag.tagger.name), |
564 | - date: tag.tagger.date.toLocaleString(req._locale) | |
572 … | + date: date && date.toLocaleString(req._locale) | |
565 | 573 … | }) + '<br/>' + |
566 | 574 … | u.link([repo.id, tag.type, tag.object]) + |
567 | 575 … | u.linkify(u.pre(body)) + |
568 | 576 … | '</section>'))) |
package.json | ||
---|---|---|
@@ -1,7 +1,7 @@ | ||
1 | 1 … | { |
2 | 2 … | "name": "git-ssb-web", |
3 | - "version": "1.16.0", | |
3 … | + "version": "1.16.1", | |
4 | 4 … | "description": "web server for browsing git repos on ssb", |
5 | 5 … | "bin": "server.js", |
6 | 6 … | "dependencies": { |
7 | 7 … | "asyncmemo": "^0.1.0", |
@@ -11,9 +11,9 @@ | ||
11 | 11 … | "multicb": "^1.2.1", |
12 | 12 … | "node-polyglot": "^1.0.0", |
13 | 13 … | "pull-cat": "^1.1.8", |
14 | 14 … | "pull-git-pack": "^0.2.0", |
15 | - "pull-git-repo": "^0.4.1", | |
15 … | + "pull-git-repo": "^0.4.2", | |
16 | 16 … | "pull-identify-filetype": "^1.1.0", |
17 | 17 … | "pull-many": "^1.0.6", |
18 | 18 … | "pull-paramap": "^1.1.6", |
19 | 19 … | "pull-stream": "^3.1.0", |
Built with git-ssb-web