diff --git a/lib/github_changelog_generator/generator/generator_tags.rb b/lib/github_changelog_generator/generator/generator_tags.rb index b87e41ee7..8d202cf5a 100644 --- a/lib/github_changelog_generator/generator/generator_tags.rb +++ b/lib/github_changelog_generator/generator/generator_tags.rb @@ -14,13 +14,7 @@ def fetch_and_filter_tags @sorted_tags = filter_included_tags(all_sorted_tags) @sorted_tags = filter_excluded_tags(@sorted_tags) @filtered_tags = get_filtered_tags(@sorted_tags) - - # Because we need to properly create compare links, we need a sorted list - # of all filtered tags (including the excluded ones). We'll exclude those - # tags from section headers inside the mapping function. - section_tags = get_filtered_tags(all_sorted_tags) - - @tag_section_mapping = build_tag_section_mapping(section_tags, @filtered_tags) + @tag_section_mapping = build_tag_section_mapping(@filtered_tags, @filtered_tags) @filtered_tags end diff --git a/spec/unit/generator/generator_tags_spec.rb b/spec/unit/generator/generator_tags_spec.rb index 8fbc4a70b..872334e9e 100644 --- a/spec/unit/generator/generator_tags_spec.rb +++ b/spec/unit/generator/generator_tags_spec.rb @@ -84,10 +84,10 @@ def tags_from_strings(tags_strings) shared_examples_for "a changelog with some exclusions" do let(:expected_mapping) do { - tag_with_name("8") => [tag_with_name("7"), tag_with_name("8")], - tag_with_name("6") => [tag_with_name("5"), tag_with_name("6")], + tag_with_name("8") => [tag_with_name("6"), tag_with_name("8")], + tag_with_name("6") => [tag_with_name("4"), tag_with_name("6")], tag_with_name("4") => [tag_with_name("3"), tag_with_name("4")], - tag_with_name("3") => [tag_with_name("2"), tag_with_name("3")], + tag_with_name("3") => [tag_with_name("1"), tag_with_name("3")], tag_with_name("1") => [nil, tag_with_name("1")] } end