Visual Studio Projects: Assure commit id is correct when git hooks change
When the git hooks have changed and git isn't in the path, the correct git commit id can't be determined and thus be available to be included in the build. This change announces that fact and stops a build.
This commit is contained in:
parent
07229ef10d
commit
dd382f1beb
1 changed files with 14 additions and 2 deletions
|
@ -252,7 +252,7 @@ fc /b ..\.git\hooks\post-commit git-hooks\post-commit >nul
|
||||||
if %ERRORLEVEL% equ 0 goto _done_hooks
|
if %ERRORLEVEL% equ 0 goto _done_hooks
|
||||||
echo *****************************************************
|
echo *****************************************************
|
||||||
echo *****************************************************
|
echo *****************************************************
|
||||||
echo ** Installing updated git hooks repository **
|
echo ** Installing updated git hooks in repository **
|
||||||
echo *****************************************************
|
echo *****************************************************
|
||||||
echo *****************************************************
|
echo *****************************************************
|
||||||
goto _install_hooks
|
goto _install_hooks
|
||||||
|
@ -265,7 +265,19 @@ echo *****************************************************
|
||||||
:_install_hooks
|
:_install_hooks
|
||||||
copy /y git-hooks\post* ..\.git\hooks\
|
copy /y git-hooks\post* ..\.git\hooks\
|
||||||
call :WhereInPath git.exe > NUL 2>&1
|
call :WhereInPath git.exe > NUL 2>&1
|
||||||
if %ERRORLEVEL% neq 0 goto _done_hooks
|
if %ERRORLEVEL% equ 0 goto _do_hooks
|
||||||
|
echo ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING **
|
||||||
|
echo ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING **
|
||||||
|
echo ** **
|
||||||
|
echo ** Git Commit id invalid. You must perform a **
|
||||||
|
echo ** git checkout on the current branch to solve **
|
||||||
|
echo ** this problem. **
|
||||||
|
echo ** **
|
||||||
|
echo ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING **
|
||||||
|
echo ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING **
|
||||||
|
echo error: Review the Output Tab for more details.
|
||||||
|
exit 1
|
||||||
|
:_do_hooks
|
||||||
pushd ..
|
pushd ..
|
||||||
git log -1 --pretty="SIM_GIT_COMMIT_ID %%H%%nSIM_GIT_COMMIT_TIME %%aI" >.git-commit-id
|
git log -1 --pretty="SIM_GIT_COMMIT_ID %%H%%nSIM_GIT_COMMIT_TIME %%aI" >.git-commit-id
|
||||||
popd
|
popd
|
||||||
|
|
Loading…
Add table
Reference in a new issue