lib/repos/pulls.jsView |
---|
90 | 90 | P.renderPullReqCommits = function (req, pr, baseRepo, headRepo, cb) { |
91 | 91 | var self = this |
92 | 92 | self.web.pullReqs.getRevs(pr.id, function (err, revs) { |
93 | 93 | if (err) return cb(null, self.web.renderError(err)) |
94 | | - cb(null, cat([ |
95 | | - pull.once('<section>'), |
96 | | - self.renderCommitLog(req, baseRepo, revs.base, headRepo, revs.head), |
97 | | - pull.once('</section>') |
98 | | - ])) |
| 94 | + GitRepo.getMergeBase(baseRepo, revs.base, headRepo, revs.head, |
| 95 | + function (err, mergeBase) { |
| 96 | + if (err) return cb(null, self.web.renderError(err)) |
| 97 | + cb(null, cat([ |
| 98 | + pull.once('<section>'), |
| 99 | + self.renderCommitLog(req, baseRepo, mergeBase, headRepo, revs.head), |
| 100 | + pull.once('</section>') |
| 101 | + ])) |
| 102 | + } |
| 103 | + ) |
99 | 104 | }) |
100 | 105 | } |
101 | 106 | |
102 | 107 | P.renderPullReqFiles = function (req, pr, baseRepo, headRepo, cb) { |
103 | 108 | var self = this |
104 | 109 | self.web.pullReqs.getRevs(pr.id, function (err, revs) { |
105 | 110 | if (err) return cb(null, self.web.renderError(err)) |
106 | | - cb(null, cat([ |
107 | | - pull.once('<section>'), |
108 | | - self.repo.renderDiffStat(req, |
109 | | - [baseRepo, headRepo], [revs.base, revs.head]), |
110 | | - pull.once('</section>') |
111 | | - ])) |
| 111 | + GitRepo.getMergeBase(baseRepo, revs.base, headRepo, revs.head, |
| 112 | + function (err, mergeBase) { |
| 113 | + if (err) return cb(null, self.web.renderError(err)) |
| 114 | + cb(null, cat([ |
| 115 | + pull.once('<section>'), |
| 116 | + self.repo.renderDiffStat(req, |
| 117 | + [baseRepo, headRepo], [mergeBase, revs.head]), |
| 118 | + pull.once('</section>') |
| 119 | + ])) |
| 120 | + } |
| 121 | + ) |
112 | 122 | }) |
113 | 123 | } |
114 | 124 | |
115 | 125 | P.renderPullReqActivity = function (req, pr, repo, headRepo, authorLink, postId) { |