Fixed bug: Last entries get lost.

This commit is contained in:
Thorsten Eckel 2016-11-04 20:18:09 +01:00
parent 83dcb3cdf9
commit 014da21bf5

View File

@ -97,6 +97,8 @@ module GitHubChangelogGenerator
def ensure_older_tag(older_tag, newer_tag) def ensure_older_tag(older_tag, newer_tag)
return older_tag if older_tag return older_tag if older_tag
idx = sorted_tags.index { |t| t["name"] == newer_tag["name"] } idx = sorted_tags.index { |t| t["name"] == newer_tag["name"] }
# skip if we are already at the oldest element
return if idx == sorted_tags.size - 1
sorted_tags[idx - 1] sorted_tags[idx - 1]
end end