Merge pull request #817 from micove/GIT_TZ

Fix git version detection.
This commit is contained in:
micove 2015-09-12 06:33:00 -04:00
commit 53680d538d
1 changed files with 7 additions and 10 deletions

View File

@ -13,23 +13,20 @@
SETLOCAL ENABLEEXTENSIONS SETLOCAL ENABLEEXTENSIONS
set mydir=%~dp0 IF EXIST "%ProgramFiles(x86)%\Git\bin\git.exe" SET "GITPATH=%ProgramFiles(x86)%\Git\bin"
IF EXIST "%ProgramFiles%\Git\bin\git.exe" SET "GITPATH=%ProgramFiles%\Git\bin"
IF EXIST "%ProgramW6432%\Git\bin\git.exe" SET "GITPATH=%ProgramW6432%\Git\bin"
IF DEFINED GITPATH SET "PATH=%PATH%;%GITPATH%"
IF "%PROGRAMFILES(x86)%" == "" do ( FOR /F "tokens=1-2" %%i IN ('"git show -s --format=%%%ci HEAD 2> NUL"') do (
set PROGRAMFILES(x86)=%PROGRAMFILES% set REV3=%%i%%j
)
set PATH=%PATH%;"%PROGRAMFILES(x86)%\Git\bin"
FOR /F "delims=+" %%i IN ('"git show -s --format=%%%ci HEAD"') do (
set REV3=%%i
) )
set REV2=%REV3: =% set REV2=%REV3: =%
set REV1=%REV2:-=% set REV1=%REV2:-=%
set REV=%REV1::=% set REV=%REV1::=%
git show -s git show -s > NUL 2>&1
if %ERRORLEVEL% NEQ 0 ( if %ERRORLEVEL% NEQ 0 (
echo Automatic version detection unavailable. echo Automatic version detection unavailable.
echo If you want to have the version string print correctly, echo If you want to have the version string print correctly,