Apply suggestions from code review
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
		
							parent
							
								
									f508f8dc0c
								
							
						
					
					
						commit
						84fc16c1c1
					
				@ -152,7 +152,7 @@ module Homebrew
 | 
			
		||||
      puts <<~EOS
 | 
			
		||||
        The following taps can not read their remote branches:
 | 
			
		||||
          #{failed_fetch_taps.join("\n  ")}
 | 
			
		||||
        This may be happening because the remote branch was renamed.
 | 
			
		||||
        This is happening because the remote branch was renamed or deleted.
 | 
			
		||||
        Reset taps to point to the correct remote branches by running `brew tap --repair`
 | 
			
		||||
      EOS
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
@ -483,9 +483,9 @@ EOS
 | 
			
		||||
  trap '{ /usr/bin/pkill -P $$; wait; exit 130; }' SIGINT
 | 
			
		||||
 | 
			
		||||
  local update_failed_file="$HOMEBREW_REPOSITORY/.git/UPDATE_FAILED"
 | 
			
		||||
  local failed_fetch_dirs_file="$HOMEBREW_REPOSITORY/.git/FAILED_FETCH_DIRS"
 | 
			
		||||
  local missing_remote_ref_dirs_file="$HOMEBREW_REPOSITORY/.git/FAILED_FETCH_DIRS"
 | 
			
		||||
  rm -f "$update_failed_file"
 | 
			
		||||
  rm -f "$failed_fetch_dirs_file"
 | 
			
		||||
  rm -f "$missing_remote_ref_dirs_file"
 | 
			
		||||
 | 
			
		||||
  for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*
 | 
			
		||||
  do
 | 
			
		||||
@ -593,7 +593,7 @@ EOS
 | 
			
		||||
            if [[ -f "$tmp_failure_file" ]] &&
 | 
			
		||||
               [[ "$(<"$tmp_failure_file")" = "fatal: couldn't find remote ref refs/heads/$UPSTREAM_BRANCH_DIR" ]]
 | 
			
		||||
            then
 | 
			
		||||
              echo "$DIR" >>"$failed_fetch_dirs_file"
 | 
			
		||||
              echo "$DIR" >>"$missing_remote_ref_dirs_file"
 | 
			
		||||
            fi
 | 
			
		||||
          fi
 | 
			
		||||
        fi
 | 
			
		||||
@ -613,11 +613,11 @@ EOS
 | 
			
		||||
    export HOMEBREW_UPDATE_FAILED="1"
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
  if [[ -f "$failed_fetch_dirs_file" ]]
 | 
			
		||||
  if [[ -f "$missing_remote_ref_dirs_file" ]]
 | 
			
		||||
  then
 | 
			
		||||
    HOMEBREW_FAILED_FETCH_DIRS="$(<"$failed_fetch_dirs_file")"
 | 
			
		||||
    rm -f "$failed_fetch_dirs_file"
 | 
			
		||||
    export HOMEBREW_FAILED_FETCH_DIRS
 | 
			
		||||
    HOMEBREW_MISSING_REMOTE_REF_DIRS="$(<"$missing_remote_ref_dirs_file")"
 | 
			
		||||
    rm -f "$missing_remote_ref_dirs_file"
 | 
			
		||||
    export HOMEBREW_MISSING_REMOTE_REF_DIRS
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
  for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*
 | 
			
		||||
 | 
			
		||||
@ -375,7 +375,7 @@ class Tap
 | 
			
		||||
    path.git_rename_branch old: current_upstream_head, new: new_upstream_head
 | 
			
		||||
    path.git_branch_set_upstream local: new_upstream_head, origin: new_upstream_head
 | 
			
		||||
 | 
			
		||||
    ohai "#{name}: changed default branch name from #{current_upstream_head} to #{new_upstream_head}"
 | 
			
		||||
    ohai "#{name}: changed default branch name from #{current_upstream_head} to #{new_upstream_head}!"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # Uninstall this {Tap}.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user