From 20495e4475d396cb21dd664d66820bf3ae270876 Mon Sep 17 00:00:00 2001 From: Guy Scharf Date: Thu, 6 Feb 2020 11:59:17 -0700 Subject: [PATCH] Third time's the charm -- fix "-plus" notation for Windows --- oscar/update_gitinfo.bat | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/oscar/update_gitinfo.bat b/oscar/update_gitinfo.bat index 756f7590..652a21fc 100755 --- a/oscar/update_gitinfo.bat +++ b/oscar/update_gitinfo.bat @@ -10,12 +10,15 @@ for /f %%i in ('git rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%i if "%GIT_BRANCH%"=="HEAD" set GIT_BRANCH="" for /f %%i in ('git rev-parse --short HEAD') do set GIT_REVISION=%%i git diff-index --quiet HEAD -- -if %ERRORLEVEL% NEQ 0 ( - set GIT_REVISION=%GIT_REVISION%-plus - set GIT_TAG= - goto GitDone -) +set GIT_INDEX=%errorlevel% +if "%GIT_INDEX%"=="0" goto GitTag + +set GIT_REVISION=%GIT_REVISION%-plus +set GIT_TAG= +goto GitDone + +:GitTag for /f %%i in ('git describe --exact-match --tags') do set GIT_TAG=%%i :GitDone