Skip to content
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

Add revision secondary sort to resolve_latest_keg #11849

Merged
merged 2 commits into from
Aug 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion Library/Homebrew/cli/named_args.rb
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,11 @@ def resolve_latest_keg(name)

stable_kegs = kegs.reject { |k| k.version.head? }

return kegs.max_by { |keg| Tab.for_keg(keg).source_modified_time } if stable_kegs.blank?
if stable_kegs.blank?
return kegs.max_by do |keg|
[Tab.for_keg(keg).source_modified_time, keg.version.revision]
end
cnnrmnn marked this conversation as resolved.
Show resolved Hide resolved
end

stable_kegs.max_by(&:version)
end
Expand Down