From 883ac22239036025896ff99bd4b2a6d02712f39f Mon Sep 17 00:00:00 2001 From: Pádraig Brady
Date: Tue, 26 Oct 2010 17:55:10 +0100 Subject: cp: make --attributes-only override --reflink completely * doc/coreutils.texi (cp invocation): Change the description slightly so as users might not immediately discount using this option. Mention that --reflink is overridden by the other linking options and --attributes-only, and give an example where this might be useful. * src/copy.c (copy_internal): Bypass the reflink if --attributes-only is specifed. * tests/cp/reflink-perm: Ensure both --reflink modes are overridden by --attributes-only. * NEWS: Mention the change in behavior. Reported by Jim Meyering. --- tests/cp/reflink-perm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/cp') diff --git a/tests/cp/reflink-perm b/tests/cp/reflink-perm index 77f119f4a..e1c12aa5a 100755 --- a/tests/cp/reflink-perm +++ b/tests/cp/reflink-perm @@ -39,8 +39,11 @@ test "$mode" = "-rwxrwxrwx" || fail=1 test copy -nt file && fail=1 +# Ensure that --attributes-only overrides --reflink completely echo > file2 # file with data cp --reflink=auto --preserve --attributes-only file2 empty_copy || fail=1 test -s empty_copy && fail=1 +cp --reflink=always --preserve --attributes-only file2 empty_copy || fail=1 +test -s empty_copy && fail=1 Exit $fail -- cgit v1.2.3-70-g09d2