git ssb

30+

cel / git-ssb-web



Commit 2b3549a44739b6c2e7b68be4f1d833ad68f7d654

Handle missing commit.id

Charles E. Lehner committed on 11/19/2020, 12:48:43 PM
Parent: 2e0f4754d77ef48d1fe5df444a5025a8f477a250

Files changed

lib/repos/index.jschanged
lib/repos/index.jsView
@@ -622,21 +622,24 @@
622622 if (!rev) return pull.empty()
623623 return u.readOnce(function (cb) {
624624 repo.getCommitParsed(rev, function (err, commit) {
625625 if (err) return cb(err)
626- var commitPath = [repo.id, 'commit', commit.id]
626 + var commitId = typeof commit.id === 'string' && commit.id
627 + var commitPath = commitId && [repo.id, 'commit', commitId]
627628 var actor = commit.separateAuthor ? 'author' : 'committer'
628629 var actionKey = actor.slice(0,1).toUpperCase() + actor.slice(1) + 'ReleasedCommit'
629630 cb(null,
630631 '<span>' +
631632 req._t(actionKey, {
632633 name: u.escape(commit[actor].name),
633- commitName: u.link(commitPath, commit.title)
634 + commitName: commitPath
635 + ? u.link(commitPath, commit.title)
636 + : commit.title
634637 }) +
635638 '</span>' +
636639 '<span class="float-right">' +
637640 req._t('LatestOn', {
638- commitId: commit.id.slice(0, 7),
641 + commitId: commitId && commitId.slice(0, 7),
639642 date: commit[actor].date.toLocaleString(req._locale)
640643 }) +
641644 '</span>'
642645 )

Built with git-ssb-web