From c42e5d7ef0311fd067e8d084060b4e104df5966a Mon Sep 17 00:00:00 2001 From: sawinglogz <3787776-sawinglogz@users.noreply.gitlab.com> Date: Tue, 7 May 2019 15:56:21 -0400 Subject: [PATCH] update_gitinfo.bat fixes from Guy --- oscar/update_gitinfo.bat | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) mode change 100644 => 100755 oscar/update_gitinfo.bat diff --git a/oscar/update_gitinfo.bat b/oscar/update_gitinfo.bat old mode 100644 new mode 100755 index 5f85c45d..9ffd20b8 --- a/oscar/update_gitinfo.bat +++ b/oscar/update_gitinfo.bat @@ -4,13 +4,10 @@ set DIR=%~dp0 for /f %%i in ('git --work-tree %DIR% rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%i for /f %%i in ('git --work-tree %DIR% rev-parse --short HEAD') do set GIT_REVISION=%%i -git --work-tree $DIR diff-index --quiet HEAD -if %ERRORLEVEL% neq 0 ( - do set GIT_REVISION="%GIT_REVISION%+" # uncommitted changes -) +git --work-tree %DIR% diff-index --quiet HEAD || set GIT_REVISION=%GIT_REVISION%+ -if "%GIT_BRANCH"=="" set GIT_BRANCH="Unknown"; -if "%GIT_REVISION"=="" set GIT_REVISION="Unknown"; +if "%GIT_BRANCH"=="" set GIT_BRANCH="Unknown" +if "%GIT_REVISION"=="" set GIT_REVISION="Unknown" echo // This is an auto generated file > %DIR%git_info.new echo const QString GIT_BRANCH="%GIT_BRANCH%"; >> %DIR%git_info.new @@ -18,7 +15,7 @@ echo const QString GIT_REVISION="%GIT_REVISION%"; >> %DIR%git_info.new fc %DIR%git_info.h %DIR%git_info.new > nul if errorlevel 0 ( - del /y %DIR%git_info.new + del /q %DIR%git_info.new ) else ( echo Updating %DIR%git_info.h move /y %DIR%git_info.new %DIR%git_info.h