anchor.diff:  %lib_git% validate_version VENDORED %GIT_VERSION_VENDORED%
   
   :: Check if git is in path
  -for /F "delims=" %%F in ('where git.exe 2^>nul ^| find "\cmd\git.exe"') do (
  -    :: Get the absolute path to the user provided git binary
  -    %lib_git% is_git_shim "%%~dpF"
  -    %lib_git% get_user_git_version
  -    %lib_git% compare_git_versions
  -
  -    if defined GIT_INSTALL_ROOT (
  -        goto :FOUND_GIT
  -    )
  -)
  +for /F "delims=" %%F in ('where git.exe 2^>nul') do call :check_git "%%~fF"
  +
  +if defined GIT_INSTALL_ROOT (
  +    goto :FOUND_GIT
  +) else (
  +    goto :VENDORED_GIT
  +)
  +
  +:check_git
  +    set full_path="%~f1"
  +    if not defined GIT_INSTALL_ROOT (
  +        if not [\%full_path:\cmd\git.exe=:%]==[\%full_path%] (
  +            :: Get the absolute path to the user provided git binary
  +            %lib_git% is_git_shim "%%~dp1"
  +            %lib_git% get_user_git_version
  +            %lib_git% compare_git_versions
  +        )
  +    )
  +    exit /b
   
   :: Our last hope: use vendored git
   :VENDORED_GIT
  
positive.code: :: also check that we have a recent enough version of git by examining the version string
  if defined GIT_INSTALL_ROOT (
      if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" goto :SPECIFIED_GIT
  ) else if "%fast_init%" == "1" (
      if exist "%CMDER_ROOT%\vendor\git-for-windows\cmd\git.exe" (
          %print_debug% init.bat "Skipping Git Auto-Detect!"
  
negative.code: :: Use /max_depth 1-5 to set max recurse depth for calls to `enhance_path_recursive`
  if not defined max_depth set max_depth=1
  
  :: Add *nix tools to end of path. 0 turns off *nix tools, 2 adds *nix tools to the front of the path.
  if not defined nix_tools set nix_tools=1
  
  set "CMDER_USER_FLAGS= "
  