From a94ed5b3a739a32e33966e92554ba446ebf0fa5f Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Fri, 12 May 2023 23:20:37 +0300 Subject: [PATCH] add check of staged files so as not to add extra files to the commit --- builder | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/builder b/builder index 7b84c22..e012c34 100644 --- a/builder +++ b/builder @@ -1048,8 +1048,13 @@ function update_by_git () if git pull origin master --tags; then Version="$(version)" pushd "$MutSource" &> /dev/null - git add "$ScriptDir" &> /dev/null - git commit -m "update build tools to $Version" + if [[ -z "$(git diff --name-only --staged)" ]]; then + git add "$ScriptDir" &> /dev/null + git commit -m "update build tools to $Version" + else + warn "The build tools updated to $Version" + warn "This update is not commited because staged files were found in the project folder" + fi popd &> /dev/null msg "Successfully updated to $Version" "${GRN}" else