Sha256: 8ed5fcd6c85593700aa4eabda0b581ab8c010a0d4e31c82a29920fbb562f71e2

Contents?: true

Size: 424 Bytes

Versions: 10

Compression:

Stored size: 424 Bytes

Contents

# frozen_string_literal: true
module Shipit
  class FirstParentCommitsIterator < OctokitIterator
    def each
      last_ancestor = nil
      super do |commit|
        unless last_ancestor
          yield last_ancestor = commit
          next
        end

        if last_ancestor.parents.empty? || last_ancestor.parents.first.sha == commit.sha
          yield last_ancestor = commit
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
shipit-engine-0.39.0 lib/shipit/first_parent_commits_iterator.rb
shipit-engine-0.38.0 lib/shipit/first_parent_commits_iterator.rb
shipit-engine-0.37.0 lib/shipit/first_parent_commits_iterator.rb
shipit-engine-0.36.1 lib/shipit/first_parent_commits_iterator.rb
shipit-engine-0.36.0 lib/shipit/first_parent_commits_iterator.rb
shipit-engine-0.35.1 lib/shipit/first_parent_commits_iterator.rb
shipit-engine-0.35.0 lib/shipit/first_parent_commits_iterator.rb
shipit-engine-0.34.0 lib/shipit/first_parent_commits_iterator.rb
shipit-engine-0.33.0 lib/shipit/first_parent_commits_iterator.rb
shipit-engine-0.32.0 lib/shipit/first_parent_commits_iterator.rb