diff --git a/lib/github_changelog_generator/octo_fetcher.rb b/lib/github_changelog_generator/octo_fetcher.rb index 971c50aa..e060cde4 100644 --- a/lib/github_changelog_generator/octo_fetcher.rb +++ b/lib/github_changelog_generator/octo_fetcher.rb @@ -345,7 +345,13 @@ def default_branch # @param [String] name # @return [Array] def commits_in_branch(name) - @branches ||= client.branches(user_project).map { |branch| [branch[:name], branch] }.to_h + @branches ||= lambda do + iterate_pages(client, "branches") do |branches| + branches_map = branches.to_h { |branch| [branch[:name], branch] } + return branches_map if branches_map[name] + end + return {} + end.call if (branch = @branches[name]) commits_in_tag(branch[:commit][:sha])