mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
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:
+3
-3
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user