Skip to content

Commit

Permalink
Consider prereleases regardless of whether locked
Browse files Browse the repository at this point in the history
Prereleases are NOT considered even when the dependency specification
includes a prerelease segment, if the dependency is not locked. To me
that doesn't make sense, because I could create a Gemfile with say gem
"rails", ">= 7.0.0.beta1" and I'd expect prereleases considered there
even if there's no lock file yet.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
  • Loading branch information
2 people authored and matzbot committed Mar 28, 2023
1 parent b31bd8b commit 67f37b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bundler/gem_version_promoter.rb
Expand Up @@ -93,7 +93,7 @@ def sort_dep_specs(specs, package)
locked_version = package.locked_version

result = specs.sort do |a, b|
unless locked_version && (package.prerelease_specified? || pre?)
unless package.prerelease_specified? || pre?
a_pre = a.prerelease?
b_pre = b.prerelease?

Expand Down

0 comments on commit 67f37b0

Please sign in to comment.