Skip to content

Commit

Permalink
sh: use cp -a --attributes-only instead of touch -mr
Browse files Browse the repository at this point in the history
  • Loading branch information
intelfx committed Mar 26, 2023
1 parent 6bf1280 commit 4d9f215
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/formats/sh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ cp_reflink() {
if [ -z "$STAMPFILE2" ]; then
STAMPFILE2=$(mktemp "${TMPDIR:-/tmp}/rmlint.XXXXXXXX.stamp")
fi
touch -mr "$1" -- "$STAMPFILE2"
cp --archive --attributes-only --no-target-directory -- "$1" "$STAMPFILE2"
if [ -d "$1" ]; then
rm -rf -- "$1"
fi
cp --archive --reflink=always -- "$2" "$1"
touch -mr "$STAMPFILE2" -- "$1"
cp --archive --attributes-only --no-target-directory -- "$STAMPFILE2" "$1"
fi
fi
}
Expand Down

0 comments on commit 4d9f215

Please sign in to comment.