From e8b3655a375c43e23a9057ce4f79d0f5ac285a32 Mon Sep 17 00:00:00 2001 From: ♪ I'm a bot, bot, bot ♪ <_update_docs_trans@sundries01.phx2.fedoraproject.org> Date: Dec 18 2020 21:44:11 +0000 Subject: automatic update of pot/po files --- diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 687486e..7ab3e5a 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -13,7 +13,7 @@ function clean_tmp() { trap clean_tmp exit -for staged in $(git status --porcelain); do +for staged in $(git diff --name-only --cached); do if [ "${staged##*.}" == "pot" ] ; then echo "$staged" git diff --no-ext-diff --cached --patch-with-raw --output="$output" "$staged" @@ -25,7 +25,12 @@ for staged in $(git status --porcelain); do if [ "$countChanges" -eq $(("$countDateAdd" + "$countDateRem")) ] ; then echo "the file $staged only contains POT-Creation-Date" - git rm --cached "$staged" + git reset -q HEAD "$staged" fi fi done + +if [ $(git diff --name-only --cached | wc -l) -eq 0 ]; then + echo "nothing to commit, aborting..." + exit 1 +fi