It is hard to spot without the brackets, but the last else block - that resets %test_dir% and
logs in verbose mode that an older user git version will be ignored - can't actually be reached.
The else block is considered to belong to the if clause "if exist "%test_dir:~0,-4%\cmd\git.exe""
that will only ever be executed if ERRORLEVEL is greather than or equal to 0, thus if the test fails,
the following else if clause "else if ERRORLEVEL 0" will always succeed and the last else block will be ignored.
Using the vendored git version may still have worked because %GIT_INSTALL_ROOT% isn't set either way,
but to enable the log message I reordered if-else-clauses and brackets in the way I think the
original author intended them to work.
%errorlevel% was always 0, even if the vendored git version was more current than the installed one
Usually exiting a batch script with "exit /b exitCode" as used in :compare_versions
sets %errorlevel% to the specified exit code
However, this may not work if %errorlevel% was set before with "Set errorlevel="
I didn't find the location where this might have happened,
but I saw the consequence of %errorlevel% always being 0
Thus I decided to use ERRORLEVEL instead as this will always work regardless of environment variable
For more information check https://ss64.com/nt/errorlevel.html
The below enables Cmder Fast Init mode for `cmd.exe` sessions. This is more like the Cmder 1.3.5 init process. See issue #1821
Cmder Fast Init mode bypasses or disables the following Cmder 1.3.6+ features:
* Git root and version detection. Defaults to `%cmder_root%\vendor\git-for-windows` if it exists.
* Path enhance validation before path modify so `%Path%` enhancements are forced.
* Recursive path add for `"%CMDER_ROOT%\bin"`
* Recursive path add for `"%CMDER_USER_BIN%\bin"` if `/c [user_config_folder` is specified.
* `/d` switch to enable debug output.
* `/v` switch to enable debug output.
Add `/f` to Cmder task as shown below t enable fast init:
_Note 1: This setting is invalid in Cmder `Powershell` and `Bash` sessions~_
_Note 2: Add `/t` also to see init timer output_
![image](https://user-images.githubusercontent.com/7318053/47957637-052e3880-df90-11e8-93ef-91e1ab696d82.png)
Cuts ~2.4 seconds off of init time.
![image](https://user-images.githubusercontent.com/7318053/47957795-45db8100-df93-11e8-8ae0-551d12c4e2dc.png)