From d8f3d06bb1cbc19e559245aac9f38069264a8a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Sat, 31 Aug 2024 09:12:05 +0200 Subject: [PATCH] improve script --- MAKE.bat | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/MAKE.bat b/MAKE.bat index 2c75810..6333dde 100644 --- a/MAKE.bat +++ b/MAKE.bat @@ -238,12 +238,15 @@ if "%1"=="push" ( exit /b 1 ) - git fetch origin - git rev-parse HEAD > .git\FETCH_HEAD - fc .git\HEAD .git\FETCH_HEAD > nul + git status | findstr /C:"Changes to be committed:" > nul if !ERRORLEVEL! equ 0 ( - echo Already up to date with remote. Nothing to push. - exit /b 0 + echo There are staged changes. Proceeding with push. + ) else ( + git status | findstr /C:"Your branch is up to date with" > nul + if !ERRORLEVEL! equ 0 ( + echo Your branch is already up to date. No need to push. + exit /b 0 + ) ) git status