From: Karel Zak Date: Thu, 6 Mar 2025 09:23:36 +0000 (+0100) Subject: tools/git-tp-sync: fix checkout -f use X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=632e9008a3d0f943f375e2f54c917098e56e43c6;p=thirdparty%2Futil-linux.git tools/git-tp-sync: fix checkout -f use Signed-off-by: Karel Zak (cherry picked from commit e21b9fa759b07b251b1e790ee5356dcdf46da55a) --- diff --git a/tools/git-tp-sync b/tools/git-tp-sync index e9170660b..a712d3525 100755 --- a/tools/git-tp-sync +++ b/tools/git-tp-sync @@ -182,7 +182,9 @@ function regenerate_po_files { # ignore files where is only modified one line ("POT-Creation-Date") PO_IGNORE=$(git diff --numstat $PODIR/*.po | gawk -v ORS=" " '/1[[:blank:]]1[[:blank:]]/ { print $3 }') - git checkout -f $PO_IGNORE &> /dev/null + if [ -n "$PO_IGNORE" ]; then + git checkout -f $PO_IGNORE &> /dev/null + fi if [ $(git ls-files -m "$PODIR" | wc -l) -gt 0 ]; then if [ "$DRYRUN" = "true" ]; then