hooks/post-merge: Skip time updates for directories

This will erroneously lead to synchronization for the entire tree.
This commit is contained in:
Alex Palaistras 2021-09-19 17:42:22 +01:00
parent d6e9b9db4d
commit 692e74e329

View File

@ -38,6 +38,11 @@ function sync-coreos-config() {
# Update timestamp for temporary file to match last commit time, in order to ensure # Update timestamp for temporary file to match last commit time, in order to ensure
# correct partial updates. # correct partial updates.
for f in "$dir/"**; do for f in "$dir/"**; do
# Skip directories, as updating their commit times will have all files within be synchronized.
if test -d "$f"; then
continue
fi
touch --date="$(git -C "$TEMP_CONFIG_PATH" log -n 1 --pretty=format:%cd --date=iso --date-order -- "$f")" -- "$f" touch --date="$(git -C "$TEMP_CONFIG_PATH" log -n 1 --pretty=format:%cd --date=iso --date-order -- "$f")" -- "$f"
done done