]> 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 11:13:28 +0000 (12:13 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit e21b9fa759b07b251b1e790ee5356dcdf46da55a)

tools/git-tp-sync

index e9170660bff78e82d89988f289aec41a478510c3..a712d35253edeb39f6ea31dd4337bd7907f402e3 100755 (executable)
@@ -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