aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/render-msg.js1
-rw-r--r--lib/serve.js18
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index aaf7271..b4ba87a 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -694,6 +694,7 @@ RenderMsg.prototype.gitUpdate = function (cb) {
var type = /^refs\/tags/.test(ref) ? 'tag' : 'commit'
var path = id && ('/git/' + type + '/' + encodeURIComponent(id)
+ '?msg=' + encodeURIComponent(self.msg.key))
+ + '&search=1'
return h('li',
ref.replace(/^refs\/(heads|tags)\//, ''), ': ',
id ? h('a', {href: self.render.toUrl(path)}, h('code', id))
diff --git a/lib/serve.js b/lib/serve.js
index 145777d..2eecd09 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -1739,6 +1739,24 @@ Serve.prototype.gitCommit = function (rev) {
self.respondSink(400)
)
+ if (self.query.search) {
+ return self.app.git.getObjectMsg({
+ obj: rev,
+ headMsgId: self.query.msg,
+ }, function (err, msg) {
+ if (err && err.name === 'BlobNotFoundError')
+ return self.askWantBlobs(err.links)
+ if (err) return pull(
+ pull.once(u.renderError(err).outerHTML),
+ self.wrapPage('git commit ' + rev),
+ self.respondSink(400)
+ )
+ var path = '/git/commit/' + rev
+ + '?msg=' + encodeURIComponent(msg.key)
+ return self.redirect(self.app.render.toUrl(path))
+ })
+ }
+
self.app.git.openObject({
obj: rev,
msg: self.query.msg,