dev-cmd/audit: only go back in git history until revision or version changes
This commit is contained in:
		
							parent
							
								
									59b1309900
								
							
						
					
					
						commit
						a8a83d1f24
					
				@ -928,6 +928,7 @@ module Homebrew
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        break if previous_version && current_version != previous_version
 | 
			
		||||
        break if previous_revision && current_revision != previous_revision
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      if current_version == previous_version &&
 | 
			
		||||
 | 
			
		||||
@ -746,6 +746,17 @@ module Homebrew
 | 
			
		||||
          it { is_expected.to be_nil }
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        context "should not warn when revision from previous version matches current revision" do
 | 
			
		||||
          before do
 | 
			
		||||
            formula_gsub_origin_commit "foo-1.0.tar.gz", "foo-1.1.tar.gz"
 | 
			
		||||
            formula_gsub_origin_commit "revision 2", "# no revision"
 | 
			
		||||
            formula_gsub_origin_commit "# no revision", "revision 1"
 | 
			
		||||
            formula_gsub_origin_commit "revision 1", "revision 2"
 | 
			
		||||
          end
 | 
			
		||||
 | 
			
		||||
          it { is_expected.to be_nil }
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        context "should only increment by 1 with an uncommitted version" do
 | 
			
		||||
          before do
 | 
			
		||||
            formula_gsub "foo-1.0.tar.gz", "foo-1.1.tar.gz"
 | 
			
		||||
@ -776,8 +787,8 @@ module Homebrew
 | 
			
		||||
        context "should not decrease with a new version" do
 | 
			
		||||
          before do
 | 
			
		||||
            formula_gsub_origin_commit "foo-1.0.tar.gz", "foo-1.1.tar.gz"
 | 
			
		||||
            formula_gsub_origin_commit "version_scheme 1", ""
 | 
			
		||||
            formula_gsub_origin_commit "revision 2", ""
 | 
			
		||||
            formula_gsub_origin_commit "version_scheme 1", ""
 | 
			
		||||
          end
 | 
			
		||||
 | 
			
		||||
          it { is_expected.to match("version_scheme should not decrease (from 1 to 0)") }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user