utils: kernel-refresh.sh: Only remove old patches if they exist

E.g., when upgrading to a new version, there are no previous patches
to remove.
This commit is contained in:
Tobias Waldekranz
2024-12-02 16:52:35 +01:00
parent fbe18a4ae0
commit fcef1ead3a
+4 -1
View File
@@ -60,6 +60,9 @@ if ! [ "$PDIR" ]; then
exit 1
fi
git -C $PDIR rm *.patch
KDIR=$(readlink -f $KDIR)
PDIR=$(readlink -f $PDIR)
git ls-files --error-unmatch $PDIR 1>/dev/null 2>&1 && git -C $PDIR rm *.patch
git -C $KDIR format-patch -o $PDIR $KTAG..HEAD
git -C $PDIR add *.patch