From d82fece61e2fb2ce7a82915a458b1840785ab7e1 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 23 Jan 2023 19:16:44 -0800 Subject: [PATCH] Remove unnecessary git actions in fiast init --- vendor/init.bat | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/vendor/init.bat b/vendor/init.bat index c212edb..027f710 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -249,6 +249,13 @@ if defined GIT_INSTALL_ROOT ( %print_debug% init.bat "Skipping Git Auto-Detect!" goto :VENDORED_GIT ) + + %print_debug% init.bat "Fast init is enabled, vendored Git does not exist" + for /F "delims=" %%F in ('where git.exe 2^>nul') do ( + set "EXT_GIT_EXE=%%~fF" + %print_debug% init.bat "Found User installed Git at '%%~fF'. Skipping Git Auto-Detect!" + goto :SET_ENV + ) ) %print_debug% init.bat "Looking for Git install root..." @@ -321,6 +328,8 @@ if %nix_tools% geq 1 ( ) ) +:SET_ENV + :: Plink (PuTTY Link) is a command-line connection tool similar to ssh, setting its protocol to ssh set PLINK_PROTOCOL=ssh @@ -328,6 +337,12 @@ set PLINK_PROTOCOL=ssh if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe" :: Find locale.exe: From the git install root, from the path, using the git installed env, or fallback using the env from the path. +setlocal enabledelayedexpansion +if not defined git_locale if defined EXT_GIT_EXE ( + set "GIT_INSTALL_ROOT=!EXT_GIT_EXE:\cmd\git.exe=!" +) +endlocal && set GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT% + if not defined git_locale if exist "%GIT_INSTALL_ROOT%\usr\bin\locale.exe" set git_locale="%GIT_INSTALL_ROOT%\usr\bin\locale.exe" if not defined git_locale for /F "tokens=* delims=" %%F in ('where locale.exe 2^>nul') do ( if not defined git_locale set git_locale="%%F" ) if not defined git_locale if exist "%GIT_INSTALL_ROOT%\usr\bin\env.exe" set git_locale="%GIT_INSTALL_ROOT%\usr\bin\env.exe" /usr/bin/locale