test: fix t7001 cp to use POSIX options
authorKyle J. McKay <mackyle@gmail.com>
Fri, 11 Apr 2014 08:24:02 +0000 (01:24 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 11 Apr 2014 20:19:00 +0000 (13:19 -0700)
Since 11502468 and 04c1ee57 (both first appearing in v1.8.5), the
t7001-mv test has used "cp -a" to perform a copy in several of the
tests.

However, the "-a" option is not required for a POSIX cp utility and
some platforms' cp utilities do not support it.

The POSIX equivalent of -a is -R -P -p.

Change "cp -a" to "cp -R -P -p" so that the t7001-mv test works
on systems with a cp utility that only implements the POSIX
required set of options and not the "-a" option.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7001-mv.sh
index 3bfdfed1f7774edb8a87864bdb6a021dc6a185ed..9727e79b681becc2f1a8fee5d4baa0b15990fbc0 100755 (executable)
@@ -307,7 +307,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm
        (
                cd sub &&
                rm -f .git &&
-               cp -a ../.git/modules/sub .git &&
+               cp -R -P -p ../.git/modules/sub .git &&
                GIT_WORK_TREE=. git config --unset core.worktree
        ) &&
        mkdir mod &&
@@ -330,7 +330,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu
        (
                cd sub &&
                rm -f .git &&
-               cp -a ../.git/modules/sub .git &&
+               cp -R -P -p ../.git/modules/sub .git &&
                GIT_WORK_TREE=. git config --unset core.worktree
        ) &&
        mkdir mod &&