Commit 12cbbc0fcd92a745f0439eff6cad0263ed4a8fcc
Serve line-comment messages and replies
cel committed on 11/24/2017, 4:25:26 AMParent: d216b0353c9628c01e54c1dd05521f2708d6ba1b
Files changed
index.js | changed |
lib/repos/index.js | changed |
index.js | ||
---|---|---|
@@ -794,8 +794,15 @@ | ||
794 | 794 … | cb(null, self.repos.pulls.serveRepoPullReq(req, |
795 | 795 … | GitRepo(repo), pr, path)) |
796 | 796 … | }) |
797 | 797 … | }) |
798 … | + case 'line-comment': | |
799 … | + return self.getRepo(c.repo, function (err, repo) { | |
800 … | + if (err) return cb(null, | |
801 … | + self.repos.serveRepoNotFound(req, c.repo, err)) | |
802 … | + return cb(null, | |
803 … | + self.repos.serveRepoCommit(req, GitRepo(repo), c.commitId, c.filename)) | |
804 … | + }) | |
798 | 805 … | case 'issue-edit': |
799 | 806 … | if (ref.isMsgId(c.issue)) { |
800 | 807 … | return self.pullReqs.get(c.issue, function (err, issue) { |
801 | 808 … | if (err) return cb(err) |
@@ -850,8 +857,13 @@ | ||
850 | 857 … | return cb(null, |
851 | 858 … | self.repos.pulls.serveRepoPullReq(req, |
852 | 859 … | GitRepo(repo), pr, path, id)) |
853 | 860 … | }) |
861 … | + case 'line-comment': | |
862 … | + return cb(null, | |
863 … | + self.repos.serveRepoCommit(req, GitRepo(repo), rc.commitId, rc.filename)) | |
864 … | + default: | |
865 … | + return cb(null, self.serveGenericMessage(req, msg, path)) | |
854 | 866 … | } |
855 | 867 … | }) |
856 | 868 … | }) |
857 | 869 … | } |
lib/repos/index.js | ||
---|---|---|
@@ -197,9 +197,9 @@ | ||
197 | 197 … | return this.serveRepoActivity(req, repo, branch) |
198 | 198 … | case 'commits': |
199 | 199 … | return this.serveRepoCommits(req, repo, branch) |
200 | 200 … | case 'commit': |
201 | - return this.serveRepoCommit(req, repo, path[1]) | |
201 … | + return this.serveRepoCommit(req, repo, path[1], filePath) | |
202 | 202 … | case 'tag': |
203 | 203 … | return this.serveRepoTag(req, repo, branch, filePath) |
204 | 204 … | case 'tree': |
205 | 205 … | return this.serveRepoTree(req, repo, branch, filePath) |
@@ -700,9 +700,10 @@ | ||
700 | 700 … | } |
701 | 701 … | |
702 | 702 … | /* Repo commit */ |
703 | 703 … | |
704 | -R.serveRepoCommit = function (req, repo, rev) { | |
704 … | +R.serveRepoCommit = function (req, repo, rev, filePath) { | |
705 … | + // TODO: use filePath argument | |
705 | 706 … | var self = this |
706 | 707 … | return u.readNext(function (cb) { |
707 | 708 … | repo.getCommitParsed(rev, function (err, commit) { |
708 | 709 … | if (err) return cb(null, |
Built with git-ssb-web