git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Avoid using non-POSIX cp options

From
Ben Walton <bdwalton@gmail.com>
Date
Jan 1, 2013, 20:13 UTC
Message-ID
<1357071197-7927-1-git-send-email-bdwalton@gmail.com>

t/3600-rm was using the -a option to cp. This option is a GNU extention and is not portable. Instead, use just -R (no -p necessary).

Signed-off-by: Ben Walton <bdwalton@gmail.com>
---
 t/t3600-rm.sh |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index 06f6384..37bf5f1 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -474,7 +474,7 @@ test_expect_success 'rm of a conflicted populated submodule with a .git director
 	git submodule update &&
 	(cd submod &&
 		rm .git &&
-		cp -a ../.git/modules/sub .git &&
+		cp -R ../.git/modules/sub .git &&
 		GIT_WORK_TREE=. git config --unset core.worktree
 	) &&
 	test_must_fail git merge conflict2 &&
@@ -508,7 +508,7 @@ test_expect_success 'rm of a populated submodule with a .git directory fails eve
 	git submodule update &&
 	(cd submod &&
 		rm .git &&
-		cp -a ../.git/modules/sub .git &&
+		cp -R ../.git/modules/sub .git &&
 		GIT_WORK_TREE=. git config --unset core.worktree
 	) &&
 	test_must_fail git rm submod &&
@@ -606,7 +606,7 @@ test_expect_success 'rm of a populated nested submodule with a nested .git direc
 	git submodule update --recursive &&
 	(cd submod/subsubmod &&
 		rm .git &&
-		cp -a ../../.git/modules/sub/modules/sub .git &&
+		cp -R ../../.git/modules/sub/modules/sub .git &&
 		GIT_WORK_TREE=. git config --unset core.worktree
 	) &&
 	test_must_fail git rm submod &&
-- 
1.7.10.4
Next: Junio C Hamano
Message 1 of 2 in “Avoid using non-POSIX cp options”
  1. Avoid using non-POSIX cp optionsBen Walton, Jan 1, 2013
  2. Junio C HamanoJan 1, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.