Merge pull request #6582 from EricFromCanada/doctor-modified-files
doctor: list any uncommitted modified files in CI
This commit is contained in:
		
						commit
						d3d8869468
					
				@ -663,17 +663,30 @@ module Homebrew
 | 
			
		||||
      def check_git_status
 | 
			
		||||
        return unless Utils.git_available?
 | 
			
		||||
 | 
			
		||||
        modified = []
 | 
			
		||||
        HOMEBREW_REPOSITORY.cd do
 | 
			
		||||
          return if `git status --untracked-files=all --porcelain -- Library/Homebrew/ 2>/dev/null`.chomp.empty?
 | 
			
		||||
          status = `git status --untracked-files=all --porcelain -- Library/Homebrew/ 2>/dev/null`
 | 
			
		||||
          return if status.blank?
 | 
			
		||||
 | 
			
		||||
          modified = status.split("\n")
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        <<~EOS
 | 
			
		||||
        message = <<~EOS
 | 
			
		||||
          You have uncommitted modifications to Homebrew.
 | 
			
		||||
          If this is a surprise to you, then you should stash these modifications.
 | 
			
		||||
          Stashing returns Homebrew to a pristine state but can be undone
 | 
			
		||||
          should you later need to do so for some reason.
 | 
			
		||||
            cd #{HOMEBREW_LIBRARY} && git stash && git clean -d -f
 | 
			
		||||
        EOS
 | 
			
		||||
 | 
			
		||||
        if ENV["CI"]
 | 
			
		||||
          message += inject_file_list modified, <<~EOS
 | 
			
		||||
 | 
			
		||||
            Modified files:
 | 
			
		||||
          EOS
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        message
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      def check_for_bad_python_symlink
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user