build-deps - fix very very old bug with GitCloneAndCheckoutRevision not always checking out revision

Since this if-block happens in parentheses, then all `%VAR%` are expanded at the start and then `%ERRORLEVEL%` and `%RET%` values have no relation to the actual result of `git clone`. So if user were (un)lucky, then `%RET%` would be not yet set to "0" (by the previous function call), then it would skip checking out revision.

`GitCloneOrPullRepository` had similar issue, but it was never used anywhere.
This commit is contained in:
Andrej730
2025-11-21 12:41:46 +05:00
parent d3fcf39c76
commit 1b249b1013
+3 -3
View File
@@ -836,7 +836,7 @@ if not exist "%~2". (
call cecho.cmd 0 13 "Cloning %DEPENDENCY_NAME% into %~2."
pushd "%DEPS_DIR%"
call git clone %1 %2
set RET=%ERRORLEVEL%
set RET=!ERRORLEVEL!
) else (
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already cloned. Pulling latest changes."
git reset --hard
@@ -855,8 +855,8 @@ if not exist "%~2". (
call cecho.cmd 0 13 "Cloning %DEPENDENCY_NAME% into %~2."
pushd "%DEPS_DIR%"
call git clone %1 %2
set RET=%ERRORLEVEL%
if not "%RET%"=="0" exit /b %RET%
set RET=!ERRORLEVEL!
if not "!RET!"=="0" exit /b !RET!
popd
) else (
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already cloned."