From 9d01bde5699d840b0c1aa71eea2af41bdd1201bd Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 25 Feb 2015 09:00:23 +0100 Subject: refresh: Always preserve modification time In the general case, when doing a backup copy of a patch on refresh, the modification time of the file is preserved. We should do the same when the patch is a symbolic link. --- quilt/refresh.in | 2 +- test/symlink.test | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/quilt/refresh.in b/quilt/refresh.in index b7c7e55..aa9a2ae 100644 --- a/quilt/refresh.in +++ b/quilt/refresh.in @@ -326,7 +326,7 @@ then elif ( [ -z "$QUILT_BACKUP" -o ! -e "$patch_file" ] || \ if [ -L "$patch_file" ] ; \ then \ - cp "$patch_file" "$patch_file~"; \ + cp -p "$patch_file" "$patch_file~"; \ else \ mv "$patch_file" "$patch_file~"; \ fi ) && \ diff --git a/test/symlink.test b/test/symlink.test index 4610af6..51a81f2 100644 --- a/test/symlink.test +++ b/test/symlink.test @@ -28,6 +28,7 @@ # Test the refresh --backup $ echo "foo changed 3" > foo + $ touch -r patches/test.diff test.timeref $ quilt refresh --backup --no-index -p ab > Refreshed patch patches/test.diff @@ -52,6 +53,8 @@ > -foo > +foo changed 2 + $ [ patches/test.diff~ -nt test.timeref ] && echo "mtimes differ" + # Test the refresh when target is read-only $ chmod -w test.diff $ echo "foo changed 4" > foo -- cgit