Skip to content

Avoid processing a single commit multiple times #1058

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/github_changelog_generator/octo_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,15 @@ def commits_in_tag(sha, shas = Set.new)
queue = [current]
while queue.any?
commit = queue.shift
# If we've already processed this sha, just grab it's parents from the cache
if @commits_in_tag_cache.key?(commit[:sha])
# If we've already processed this sha in a previous run, just grab
# its parents from the cache
shas.merge(@commits_in_tag_cache[commit[:sha]])
elsif shas.include?(commit[:sha])
# If we've already processed this sha in the current run, stop there
# for the current commit because its parents have already been
# queued/processed. Jump to the next queued commit.
next
else
shas.add(commit[:sha])
commit[:parents].each do |p|
Expand Down