Commit 79f58730093477d5ea1846198244ca7f1e137436
Sort git tags in an update
Charles Lehner committed on 8/2/2016, 12:43:13 AMParent: faff49e67cc84e5fa54a14136d98a6126f176499
Files changed
modules/git.js | changed |
modules/git.js | ||
---|---|---|
@@ -125,23 +125,23 @@ | ||
125 | 125 | rel: 'repo', |
126 | 126 | values: true |
127 | 127 | }), |
128 | 128 | pull.drain(function (link) { |
129 | - var refUpdates = link.value.content.refs | |
130 | - for (var ref in refUpdates) { | |
131 | - if (refs[ref]) continue | |
129 | + var refUpdates = link.value.content.refs || {} | |
130 | + Object.keys(refUpdates).reverse().filter(function (ref) { | |
131 | + if (refs[ref]) return | |
132 | 132 | refs[ref] = true |
133 | 133 | var rev = refUpdates[ref] |
134 | - if (!rev) continue | |
134 | + if (!rev) return | |
135 | 135 | var parts = /^refs\/(heads|tags)\/(.*)$/.exec(ref) || [] |
136 | 136 | var t |
137 | 137 | if (parts[1] === 'heads') t = branchesT |
138 | 138 | else if (parts[1] === 'tags') t = tagsT |
139 | 139 | if (t) t.append(h('tr', |
140 | 140 | h('td', parts[2]), |
141 | 141 | h('td', h('code', rev)), |
142 | 142 | h('td', messageTimestampLink(link)))) |
143 | - } | |
143 | + }) | |
144 | 144 | }, function (err) { |
145 | 145 | if (err) console.error(err) |
146 | 146 | }) |
147 | 147 | ) |
Built with git-ssb-web