lib/repos/pulls.jsView |
---|
394 | 394 | '<div class="tab-links">' + |
395 | 395 | '<a href="#" id="files-link">' + req._t('FilesChanged') + '</a> ' + |
396 | 396 | '<a href="#commits" id="commits-link">' + |
397 | 397 | req._t('Commits') + '</a>' + |
398 | | - '</div>' + |
399 | | - '<section id="files-tab">'), |
400 | | - self.repo.renderDiffStat(req, [repo, headRepo], |
401 | | - [baseBranch, headBranch]), |
402 | | - pull.once('</section>' + |
403 | | - '<section id="commits-tab">'), |
404 | | - self.renderCommitLog(req, repo, baseBranch, headRepo, headBranch), |
405 | | - pull.once('</section>') |
| 398 | + '</div>'), |
| 399 | + u.readNext(function (cb) { |
| 400 | + GitRepo.getMergeBase(repo, baseBranch, headRepo, headBranch, |
| 401 | + function (err, concestor) { |
| 402 | + if (err) return cb(err) |
| 403 | + cb(null, cat([ |
| 404 | + pull.once('<section id="files-tab">'), |
| 405 | + self.repo.renderDiffStat(req, [repo, headRepo], |
| 406 | + [concestor, headBranch]), |
| 407 | + pull.once('</section>' + |
| 408 | + '<section id="commits-tab">'), |
| 409 | + self.renderCommitLog(req, repo, concestor, headRepo, headBranch), |
| 410 | + pull.once('</section>') |
| 411 | + ])) |
| 412 | + } |
| 413 | + ) |
| 414 | + }) |
406 | 415 | ]) |
407 | 416 | } |
408 | 417 | } |
409 | 418 | |