Merge pull request #8576 from dtrodrigues/revision-audit

audit: compare current version to last committed version when seeing if revision should be reset
This commit is contained in:
Dustin Rodrigues 2020-09-03 10:32:42 -04:00 committed by GitHub
commit 5ce013b0d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -886,7 +886,8 @@ module Homebrew
end
end
if previous_version != newest_committed_version &&
if (previous_version != newest_committed_version ||
current_version != newest_committed_version) &&
!current_revision.zero? &&
current_revision == newest_committed_revision &&
current_revision == previous_revision

View File

@ -727,6 +727,12 @@ module Homebrew
it { is_expected.to match("'revision 2' should be removed") }
end
context "should be removed with a newer local version" do
before { formula_gsub "foo-1.0.tar.gz", "foo-1.1.tar.gz" }
it { is_expected.to match("'revision 2' should be removed") }
end
context "should not warn on an newer version revision removal" do
before do
formula_gsub_origin_commit "revision 2", ""