]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tools/git-tp-sync: fix checkout -f use
authorKarel Zak <kzak@redhat.com>
Thu, 6 Mar 2025 09:23:36 +0000 (10:23 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 6 Mar 2025 09:23:36 +0000 (10:23 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
tools/git-tp-sync

index 00c847b91c02fbf01a289d146e3f465594574de7..6ae10a153a5871c2ea4e44cee12c4febe8e43327 100755 (executable)
@@ -183,7 +183,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