aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/serve.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/serve.js b/lib/serve.js
index 653a1e0..4089635 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -2426,6 +2426,7 @@ Serve.prototype.gitCommit = function (rev) {
+ '?msg=' + encodeURIComponent(msg.key))
+ '&commit=' + rev
+ '&path=' + encodeURIComponent(file.name)
+ + '&search=1'
}, 'created')
: file.hash ?
ph('a', {href:
@@ -2434,6 +2435,7 @@ Serve.prototype.gitCommit = function (rev) {
+ '?msg=' + encodeURIComponent(msg.key))
+ '&commit=' + rev
+ '&path=' + encodeURIComponent(file.name)
+ + '&search=1'
}, 'changed')
: file.mode ? 'mode changed'
: JSON.stringify(file))
@@ -2651,6 +2653,24 @@ Serve.prototype.gitBlob = 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 blob ' + rev),
+ self.respondSink(400)
+ )
+ var path = '/git/blob/' + rev
+ + '?msg=' + encodeURIComponent(msg.key)
+ return self.redirect(self.app.render.toUrl(path))
+ })
+ }
+
self.getMsgDecryptedMaybeOoo(self.query.msg, function (err, msg) {
if (err) return pull(
pull.once(u.renderError(err).outerHTML),