index.jsView |
---|
1456 | 1456 | |
1457 | 1457 | |
1458 | 1458 | } |
1459 | 1459 | |
1460 | | - var refs = c.refs ? Object.keys(c.refs).map(function (ref) { |
1461 | | - return {name: ref, value: c.refs[ref]} |
1462 | | - }) : [] |
| 1460 | + var branches = [] |
| 1461 | + var tags = [] |
| 1462 | + if (c.refs) for (var name in c.refs) { |
| 1463 | + var m = name.match(/^refs\/(heads|tags)\/(.*)$/) || [,, name] |
| 1464 | + ;(m[1] == 'tags' ? tags : branches) |
| 1465 | + .push({name: m[2], value: c.refs[name]}) |
| 1466 | + } |
1463 | 1467 | var numObjects = c.objects ? Object.keys(c.objects).length : 0 |
1464 | 1468 | |
1465 | 1469 | var dateStr = new Date(msg.value.timestamp).toLocaleString(req._locale) |
1466 | 1470 | return '<section class="collapse">' + |
1467 | 1471 | link([msg.key], dateStr) + '<br>' + |
1468 | | - refs.map(function (update) { |
1469 | | - var name = escapeHTML(update.name) |
| 1472 | + branches.map(function (update) { |
1470 | 1473 | if (!update.value) { |
1471 | | - return req._t('DeletedBranch', {branch: name}) |
| 1474 | + return '<s>' + escapeHTML(update.name) + '</s><br/>' |
1472 | 1475 | } else { |
1473 | 1476 | var commitLink = link([repo.id, 'commit', update.value]) |
1474 | | - return name + ' → <tt>' + commitLink + '</tt>' |
| 1477 | + var branchLink = link([repo.id, 'tree', update.name]) |
| 1478 | + return branchLink + ' → <tt>' + commitLink + '</tt><br/>' |
1475 | 1479 | } |
1476 | | - }).join('<br>') + |
| 1480 | + }).join('') + |
| 1481 | + tags.map(function (update) { |
| 1482 | + return update.value |
| 1483 | + ? link([repo.id, 'tag', update.value], update.name) |
| 1484 | + : '<s>' + escapeHTML(update.name) + '</s>' |
| 1485 | + }).join(', ') + |
1477 | 1486 | '</section>' |
1478 | 1487 | } |
1479 | 1488 | |
1480 | 1489 | |