Merge pull request #12186 from Bo98/update-reset-fix
cmd/update-reset: fix errors when the git shim changes in a brew update
This commit is contained in:
		
						commit
						b980fa1c91
					
				@ -4,6 +4,18 @@
 | 
			
		||||
#:
 | 
			
		||||
#:  *Note:* this will destroy all your uncommitted or committed changes.
 | 
			
		||||
 | 
			
		||||
# Replaces the function in Library/Homebrew/brew.sh to cache the Git executable to provide
 | 
			
		||||
# speedup when using Git repeatedly and prevent errors if the shim changes mid-update.
 | 
			
		||||
git() {
 | 
			
		||||
  if [[ -z "${GIT_EXECUTABLE}" ]]
 | 
			
		||||
  then
 | 
			
		||||
    # HOMEBREW_LIBRARY is set by bin/brew
 | 
			
		||||
    # shellcheck disable=SC2154
 | 
			
		||||
    GIT_EXECUTABLE="$("${HOMEBREW_LIBRARY}/Homebrew/shims/shared/git" --homebrew=print-path)"
 | 
			
		||||
  fi
 | 
			
		||||
  "${GIT_EXECUTABLE}" "$@"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
homebrew-update-reset() {
 | 
			
		||||
  local DIR
 | 
			
		||||
  local -a REPOS=()
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								Library/Homebrew/shims/scm
									
									
									
									
									
										Symbolic link
									
								
							
							
						
						
									
										1
									
								
								Library/Homebrew/shims/scm
									
									
									
									
									
										Symbolic link
									
								
							@ -0,0 +1 @@
 | 
			
		||||
shared
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user